File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
use v6 ;
2
2
use Test ;
3
- plan 5 ;
3
+ plan 6 ;
4
4
5
5
# originally for RT #66588, which was closed
6
6
# RT #74414 is related, and works on moar, but
@@ -24,4 +24,19 @@ plan 5;
24
24
is $ rw_call , 1 , ' read-write multi was called' ;
25
25
}
26
26
27
+ # ?rakudo.jvm skip 'Ambiguous dispatch'
28
+ {
29
+ # Makes sure dynamic optimization copes with the rw vs. ro distinction
30
+ # also (early patches to the MoarVM multi cache didn't handle this, so
31
+ # we could end up inlining the wrong thing; other backends are likely
32
+ # to intensively optimize multi calls too, and could hit the same kind
33
+ # of trap).
34
+ multi foo ($ x is rw ) { 1 };
35
+ multi foo ($ x ) { 2 };
36
+ foo [];
37
+ my $ got ;
38
+ for ^ 500 { $ got = foo $ = []; }
39
+ is $ got , 1 , ' Optimization respects is rw' ;
40
+ }
41
+
27
42
# vim: ft=perl6
You can’t perform that action at this time.
0 commit comments