On Wed Apr 20 02:54:29 2016, jn...@jnthn.net wrote:
> On Sun Apr 17 16:34:02 2016, pesc...@gmail.com wrote:
> > Consider the following snippet:
> >
> > 23:28 < psch> m: role Bar::Foo { }; class A { submethod BUILD { self
> > does Bar::Foo } }; A.new.WHAT.say
> > 23:28 <+camelia> rakudo-moar 617bb4: OUTPUT«(Foo})␤»
> >
> > Clearly, A is not of type 'Foo}'. As far as I can tell
> > Perl6::Metamodel::Naming is involved, although I'm not sure why this
> > only happens with mixins during BUILD. I'd expect .WHAT to report
> > 'A+{Bar::Foo}' instead.
> 
> Nothing to do build BUILD. It golfs to:
> 
> role Foo::Bar { }; say (42 but Foo::Bar).^shortname
> 
> And it'll be because of this overly-naive code:
> 
> https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Metamodel/Naming.nqp#L6
> 
> Maybe set_name should take an optional second parameter for the short
> name, and the mixin code can set it explicitly.
> 
> /jnthn

Fixed in Rakudo commit 60550d15, test added in roast commit 95a5c18.

Reply via email to