Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reference to outside function prevents role instantiation #5271

Open
p6rt opened this issue Apr 27, 2016 · 2 comments
Open

reference to outside function prevents role instantiation #5271

p6rt opened this issue Apr 27, 2016 · 2 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Apr 27, 2016

Migrated from rt.perl.org#128010 (status was 'new')

Searchable as RT128010$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Apr 27, 2016

From @grondilu

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 {} ;’

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jul 9, 2016

From @zoffixznet

Still present on This is Rakudo version 2016.06-154-g55c359e built on MoarVM version 2016.06-9-g8fc21d5
implementing Perl 6.c.

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.