You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In file A.pm6 : unit class A ; our sub f {}
In file B.pm6 : unit role B ; use A ; &A ::f ;
$ perl6 -I. -e ‘use B ; class :: does B {} ;’
===SORRY!=== Error while compiling -e
Could not instantiate role 'B':
Cannot find method 'package_at_key': no method cache and no .^find_method
at -e:1
Notice that &A ::f is not even called, only its reference is used in void context.
Also notice that without explicit compilation units it works fine :
$ perl6 -e ‘class A { our sub f {} } ; role B { &A::f } ; class :: does B {} ;’
$ mkdir gh5271
$ echo 'unit class A; our sub f {}' >gh5271/A.rakumod
$ echo 'unit role B; use A; &A::f' >gh5271/B.rakumod
$ ./rakudo-m -Igh5271 -e 'use B; class :: does B {}; say "alive"'
alive
Migrated from rt.perl.org#128010 (status was 'new')
Searchable as RT128010$
The text was updated successfully, but these errors were encountered: