Created
April 10, 2021 14:34
-
-
Save Tux/110e7b8e266b5f5d900b8d0d060018e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
use v6; | |
class c { | |
has Str $.foo is rw = "a"; | |
method bar (Str $s) { | |
return $s ~~ / $!foo /; | |
} | |
method bux (Str $s) { | |
my $foo = $!foo; | |
return $s ~~ / $foo /; | |
} | |
} | |
c.new.bar("baz").perl.say; | |
c.new.bux("baz").perl.say; | |
``` | |
-> | |
``` | |
===SORRY!=== Error while compiling /pro/3gl/CPAN/Text-CSV6/issue-3430.pl | |
Attribute '$!foo' not available inside of a regex, since regexes are | |
methods on the Cursor class. Consider storing the attribute in a | |
lexical, and using that in the regex. | |
at /pro/3gl/CPAN/Text-CSV6/issue-3430.pl:7 | |
------> return $s ~~ / $!foo⏏ /; | |
expecting any of: | |
infix stopper | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment