File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change 1
1
use v6 ;
2
2
use Test ;
3
3
4
- plan 26 ;
4
+ plan 29 ;
5
5
6
6
eval_dies_ok(' qr/foo/' , ' qr// is gone' );
7
7
@@ -88,4 +88,35 @@ ok ';' ~~ /\;/, 'escaped ";" in m// works';
88
88
# ?niecza todo 'invalid syntax'
89
89
eval_lives_ok ' /<[..b]>/' , ' /<[..b]>/ lives' ;
90
90
91
+ # RT #118985
92
+ {
93
+ class HasSub {
94
+ sub parse (Str $ input ) {
95
+ my regex anything { . }
96
+ 42 if $ input ~~ /<anything > /
97
+ }
98
+ method call-parse-sub (Str $ input ) {
99
+ parse ($ input );
100
+ }
101
+ }
102
+
103
+ class HasSubMethod {
104
+ submethod parse (Str $ input ) {
105
+ my regex anything { . }
106
+ 43 if $ input ~~ /<anything > /
107
+ }
108
+ }
109
+
110
+ class HasMethod {
111
+ method parse (Str $ input ) {
112
+ my regex anything { . }
113
+ 44 if $ input ~~ /<anything > /
114
+ }
115
+ }
116
+
117
+ is HasSub. call-parse-sub(' foo' ), 42 , ' can have a lexical regex in a sub in a class' ;
118
+ is HasSubMethod. parse(' foo' ), 43 , ' can have a lexical regex in a submethod in a class' ;
119
+ is HasMethod. parse(' foo' ), 44 , ' can have a lexical regex in a method in a class' ;
120
+ }
121
+
91
122
# vim: ft=perl6
You can’t perform that action at this time.
0 commit comments