[perl #127916] [BUG] Inaccurate assignment to $!shortname in cases where a mixin happens during BUILD time.
On Sun Apr 24 03:51:25 2016, pesc...@gmail.com wrote: > > Fixed in Rakudo commit 60550d15, test added in roast commit 95a5c18. Great! I'm closing this ticket as 'resolved'.
[perl #127916] [BUG] Inaccurate assignment to $!shortname in cases where a mixin happens during BUILD time.
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.
[perl #127916] [BUG] Inaccurate assignment to $!shortname in cases where a mixin happens during BUILD time.
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
[perl #127916] [BUG] Inaccurate assignment to $!shortname in cases where a mixin happens during BUILD time.
# New Ticket Created by Pepe Schwarz # Please include the string: [perl #127916] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=127916 > 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.