Skip Menu |
Report information
Id: 128010
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: grondilu [at]

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Date: Wed, 27 Apr 2016 17:44:25 +0200
From: Lucien Grondin <grondilu [...]>
Subject: [BUG] reference to outside function prevents role instantiation
To: "rakudobug [...]" <rakudobug [...]>
Download (untitled) / with headers
text/plain 558b

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



Download (untitled) / with headers
text/plain 127b
Still present on This is Rakudo version 2016.06-154-g55c359e built on MoarVM version 2016.06-9-g8fc21d5 implementing Perl 6.c.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at