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

Owner: Nobody
Requestors: pcoch <paul [at] liekut.de>
Cc:
AdminCc:

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



Subject: [BUG] repeated part in full class name causes role to be undeclared in compilation
From: Paul Cochrane <paul [...] liekut.de>
Date: Wed, 28 Dec 2016 16:14:23 +0100
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 1.3k
Hi, it seems to be the case that when part of a full class name is repeated, that roles in subclasses are reported as undeclared during compilation. This issue showed up recently in Test::Builder where the word 'Test' appears twice in the full class name (Test::Builder::Test). See https://github.com/perl6-community-modules/p6-test-builder/pull/5 for more information. The issue first turned up in Rakudo commit ab946945735042ff99953f6636bdf98acd5bfc71. @ugexe managed to golf the problem to the following: Works: perl6 -e 'class A::B::A { }; role A::B::C { }; class A::B { has A::B::C $!x; };' Fails: perl6 -e '{ class A::B::A { }; }; role A::B::C { }; class A::B { has A::B::C $!x; };' Works: perl6 -e '{ class A::B::X { }; }; role A::B::C { }; class A::B { has A::B::C $!x; };' where 'Works' gives no output and 'Fails' reports the following error message: ===SORRY!=== Type 'A::B::C' is not declared ------> le A::B::C { }; class A::B { has A::B::C⏏ $!foo; }; Malformed has ------> ole A::B::C { }; class A::B { has A::B::⏏C $!foo; }; Note that only when at least the third part of the full class name is repeated that this issue occurs. If the second part is repeated, the issue does not appear, e.g., perl6 -e '{ class A::A::X { }; }; role A::A::C { }; class A::A { has A::A::C $!x; };' compiles as expected. Cheers, Paul


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

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