Skip Menu |
Report information
Id: 131409
Status: resolved
Priority: 0/
Queue: perl6

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

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



Date: Wed, 31 May 2017 03:31:39 -0700
To: rakudobug [...] perl.org
From: zengargoyle <zengargoyle [...] gmail.com>
Subject: whatever auto closure fails with smartmatch with regex
Download (untitled) / with headers
text/plain 357b
When using smartmatch against a regex, auto-whatever closure generation does not work whereas manual pointy closure does work. A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'. However, '-> $x { $x ~~ <$match>}' behaves as expected. For a test case: https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a ---- zengargoyle
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 522b
On Wed, 31 May 2017 03:31:49 -0700, zengargoyle@gmail.com wrote: Show quoted text
> When using smartmatch against a regex, auto-whatever closure generation > does not work whereas manual pointy closure does work. > > A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'. > However, '-> $x { $x ~~ <$match>}' behaves as expected. > > For a test case: > https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a > > ---- > zengargoyle
This feels very related to https://rt.perl.org/Ticket/Display.html?id=126984
Download (untitled) / with headers
text/plain 695b
On Wed, 31 May 2017 03:47:19 -0700, cpan@zoffix.com wrote: Show quoted text
> On Wed, 31 May 2017 03:31:49 -0700, zengargoyle@gmail.com wrote:
> > When using smartmatch against a regex, auto-whatever closure generation > > does not work whereas manual pointy closure does work. > > > > A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'. > > However, '-> $x { $x ~~ <$match>}' behaves as expected. > > > > For a test case: > > https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a > > > > ---- > > zengargoyle
> > > This feels very related to https://rt.perl.org/Ticket/Display.html?id=126984
Fudged tests preemptively added to S02-types/whatever.t in roast commit 4b2fef409.
Download (untitled) / with headers
text/plain 896b
On Thu, 14 Sep 2017 19:19:47 -0700, bri@abrij.org wrote: Show quoted text
> On Wed, 31 May 2017 03:47:19 -0700, cpan@zoffix.com wrote:
> > On Wed, 31 May 2017 03:31:49 -0700, zengargoyle@gmail.com wrote:
> > > When using smartmatch against a regex, auto-whatever closure > > > generation > > > does not work whereas manual pointy closure does work. > > > > > > A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'. > > > However, '-> $x { $x ~~ <$match>}' behaves as expected. > > > > > > For a test case: > > > https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a > > > > > > ---- > > > zengargoyle
> > > > > > This feels very related to > > https://rt.perl.org/Ticket/Display.html?id=126984
> > Fudged tests preemptively added to S02-types/whatever.t in roast > commit 4b2fef409.
Golfed to `<foo bar>.map({ * ~~ /<$_>/ }).eager.head.("foo").say` Should say True, but says False
On Thu, 01 Feb 2018 17:37:43 -0800, cpan@zoffix.com wrote: Show quoted text
> On Thu, 14 Sep 2017 19:19:47 -0700, bri@abrij.org wrote:
> > On Wed, 31 May 2017 03:47:19 -0700, cpan@zoffix.com wrote:
> > > On Wed, 31 May 2017 03:31:49 -0700, zengargoyle@gmail.com wrote:
> > > > When using smartmatch against a regex, auto-whatever closure > > > > generation > > > > does not work whereas manual pointy closure does work. > > > > > > > > A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'. > > > > However, '-> $x { $x ~~ <$match>}' behaves as expected. > > > > > > > > For a test case: > > > > https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a > > > > > > > > ---- > > > > zengargoyle
> > > > > > > > > This feels very related to > > > https://rt.perl.org/Ticket/Display.html?id=126984
> > > > Fudged tests preemptively added to S02-types/whatever.t in roast > > commit 4b2fef409.
> > Golfed to `<foo bar>.map({ * ~~ /<$_>/ }).eager.head.("foo").say` > > Should say True, but says False
I meant it should match, but says Nil
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 616b
On Wed, 31 May 2017 03:31:49 -0700, zengargoyle@gmail.com wrote: Show quoted text
> When using smartmatch against a regex, auto-whatever closure generation > does not work whereas manual pointy closure does work. > > A '{ * eq $match}' behaves differently than a '{ * ~~ /<$match>/}'. > However, '-> $x { $x ~~ <$match>}' behaves as expected. > > For a test case: > https://gist.github.com/zengargoyle/5a14f01a35918f6c3391b90e9b85a22a > > ---- > zengargoyle
Thank you for the report. This is now fixed. Fix: https://github.com/rakudo/rakudo/commit/d80fc376d201056 Test: https://github.com/perl6/roast/commit/323a2b65948f05d62


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