Changing uncomposed type objects to Nil for the specific case of .ast/.made
is definitely incorrect IMO.

It happens for the exact reason lizmat said in her commit: "Wish there was
a better way to test for NQPMu
though, as this will prevent type objects being properly propagated"

Although it looks like this has been fixed for composed type objects in a
following patch. It now looks like:

method ast()  { nqp::if(nqp::istype($!made, Mu),$!made,Nil) }

But since uncomposed type objects don't inherit from Mu we have the bug.

On Tue, Nov 28, 2017 at 3:26 PM Aleks-Daniel Jakimenko-Aleksejev via RT <
perl6-bugs-follo...@perl.org> wrote:

> OK, the change from True to False happened here: (2017-08-21)
>
> https://github.com/rakudo/rakudo/commit/5db5b1dbfa0b625130573574e2409972387e9f75
>
> I'm not entirely convinced that the current behavior is incorrect, but then
> again I'm sleep deprived. Maybe someone else will have a better idea.
>
> On 2017-11-27 19:00:45, lloyd.fo...@gmail.com wrote:
> > Good point. Here "No such method 'gist' for invocant of type 'Foo'
> > in block <unit> at /tmp/aR11azfzlJ line 1" is the right one.
> >
> > This will give True/False indicating correct/incorrect:
> >
> > my $new_type := Metamodel::ClassHOW.new_type(:name<Foo>);
> > my $r = / . { $/.make($new_type) } /;
> > my $m = "a" ~~ $r;
> > note $m.ast.^name eq "Foo";
> >
> > Thanks for bisecting magic!
> >
> > On Tue, Nov 28, 2017 at 1:54 PM Aleks-Daniel Jakimenko-Aleksejev via
> > RT <
> > perl6-bugs-follo...@perl.org> wrote:
> >
> > > What do you mean exactly by “used to work”? Here's the output on all
> > > 6c
> > > releases: https://gist.github.com/efee7716c35d36c6f793465c2f0b6035
> > >
> > > Which behavior is right? Or what's would be the right snippet to
> > > reproduce
> > > it?
> > >
> > > On 2017-11-27 18:48:07, lloyd.fo...@gmail.com wrote:
> > > > Just got around to investigating: https://rt.perl.org/Ticket/Dis
> > > > play.html?id=132085
> > > >
> > > > It turns out to be a regression.
> > > >
> > > > my $new_type := Metamodel::ClassHOW.new_type(:name<Foo>);
> > > > my $r = / . { make $new_type } /;
> > > > my $m = "a" ~~ $r;
> > > > note $m.ast; #-> Nil
> > > >
> > > > making an uncomposed type somehow results in Nil now. It used to
> > > > work. In
> > > > my compiler I can't really get around needing this to work.
> > > >
> > > > LL
> > >
> > >
>
>

Reply via email to