Skip Menu |
Report information
Id: 132512
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: lloyd.fourn [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [REGRESSION] make in regex on uncomposed type results in Nil
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
Date: Tue, 28 Nov 2017 02:47:51 +0000
Download (untitled) / with headers
text/plain 391b
Just got around to investigating: https://rt.perl.org/Ticket/Display.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

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.fourn@gmail.com wrote:
Show quoted text
> 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


From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Subject: Re: [perl #132512] [REGRESSION] make in regex on uncomposed type results in Nil
To: perl6-bugs-followup [...] perl.org
Date: Tue, 28 Nov 2017 02:59:55 +0000
Download (untitled) / with headers
text/plain 1.1k
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-followup@perl.org> wrote:
Show quoted text
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.fourn@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

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.fourn@gmail.com wrote:
Show quoted text
> 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-followup@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.fourn@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
> >
> >


From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
To: perl6-bugs-followup [...] perl.org
Date: Tue, 28 Nov 2017 04:56:02 +0000
Subject: Re: [perl #132512] [REGRESSION] make in regex on uncomposed type results in Nil
Download (untitled) / with headers
text/plain 2.3k
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-followup@perl.org> wrote:
Show quoted text
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.fourn@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-followup@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.fourn@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
> >
> >



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org