Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make in regex on uncomposed type results in Nil #6643

Open
p6rt opened this issue Nov 28, 2017 · 6 comments
Open

make in regex on uncomposed type results in Nil #6643

p6rt opened this issue Nov 28, 2017 · 6 comments
Labels
regression Issue did not exist previously

Comments

@p6rt
Copy link

p6rt commented Nov 28, 2017

Migrated from rt.perl.org#132512 (status was 'open')

Searchable as RT132512$

@p6rt
Copy link
Author

p6rt commented Nov 28, 2017

From @LLFourn

Just got around to investigating​: https://rt-archive.perl.org/perl6/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

@p6rt
Copy link
Author

p6rt commented Nov 28, 2017

From @AlexDaniel

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-archive.perl.org/perl6/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

@p6rt
Copy link
Author

p6rt commented Nov 28, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Nov 28, 2017

From @LLFourn

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-archive.perl.org/perl6/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

@p6rt
Copy link
Author

p6rt commented Nov 28, 2017

From @AlexDaniel

OK, the change from True to False happened here​: (2017-08-21) rakudo/rakudo@5db5b1d

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-archive.perl.org/perl6/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

@p6rt
Copy link
Author

p6rt commented Nov 28, 2017

From @LLFourn

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​:

OK, the change from True to False happened here​: (2017-08-21)

rakudo/rakudo@5db5b1d

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-archive.perl.org/perl6/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

@p6rt p6rt added the regression Issue did not exist previously label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Issue did not exist previously
Projects
None yet
Development

No branches or pull requests

1 participant