[perl #129906] Error when role stubbed as class

2016-11-09 Thread Zoffix Znet via RT
Thanks for the report.

Fixed in https://github.com/rakudo/rakudo/commit/a822bcf9cf
Tests added in https://github.com/perl6/roast/commit/1e5a081bed


[perl #129906] Error when role stubbed as class

2016-11-08 Thread Zoffix Znet via RT
There's another couple of LTA errors for this, such us when a stubbed class is 
attempted to be `does` with or when a stubbed role is `does` with before it's 
defined:

 m: class A { ... }; class B does A { }; class A { }
 rakudo-moar a581bf: OUTPUT«Unhandled exception: No such method 'item' 
for invocant of type 'A'␤   at :1  
(/home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm:print_exception)␤
 from gen/moar/m-CORE.setting:26858  (/home/camelia/rakudo-m-inst-1/share/per…»
 m: role A { ... }; class B does A { }; role A { }
 rakudo-moar a581bf: OUTPUT«Use of uninitialized value of type Any in 
string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify 
it to something meaningful.␤  in any try_select at gen/moar/m-Metamodel.nqp 
line 2647␤===SORRY!=== Error while compiling  One line example of the problem:
> 
> % perl6 -e 'class A { ... }; class B does A { }; role A { }'
> Unhandled exception: No such method 'item' for invocant of type 'A'
>at :1
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/CORE.setting.moarvm:print_exception)
>  from gen/moar/m-CORE.setting:24949
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/CORE.setting.moarvm:)
>  from gen/moar/stage2/NQPHLL.nqp:1559
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
>  from src/Perl6/Compiler.nqp:27
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/nqp/lib/Perl6/Compiler.moarvm:command_eval)
>  from gen/moar/stage2/NQPHLL.nqp:1499
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/nqp/lib/NQPHLL.moarvm:command_line)
>  from gen/moar/m-main.nqp:47
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:MAIN)
>  from gen/moar/m-main.nqp:38
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:)
>  from :1
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:)
>  from :1
>  (/Users/sterling/.rakudobrew/moar-
> nom/install/share/perl6/runtime/perl6.moarvm:)
> 
> Clearly, it would be better for there to be a nice error like "type A
> stubbed as class on line X but implemented as role on line Y".





[perl #129906] Error when role stubbed as class

2016-10-17 Thread via RT
# New Ticket Created by  hanenkamp 
# Please include the string:  [perl #129906]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=129906 >


One line example of the problem:

% perl6 -e 'class A { ... }; class B does A { }; role A { }'
Unhandled exception: No such method 'item' for invocant of type 'A'
   at :1
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:print_exception)
 from gen/moar/m-CORE.setting:24949
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:)
 from gen/moar/stage2/NQPHLL.nqp:1559
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
 from src/Perl6/Compiler.nqp:27
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/nqp/lib/Perl6/Compiler.moarvm:command_eval)
 from gen/moar/stage2/NQPHLL.nqp:1499
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/nqp/lib/NQPHLL.moarvm:command_line)
 from gen/moar/m-main.nqp:47
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/perl6/runtime/perl6.moarvm:MAIN)
 from gen/moar/m-main.nqp:38
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/perl6/runtime/perl6.moarvm:)
 from :1
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/perl6/runtime/perl6.moarvm:)
 from :1
 
(/Users/sterling/.rakudobrew/moar-nom/install/share/perl6/runtime/perl6.moarvm:)

Clearly, it would be better for there to be a nice error like "type A
stubbed as class on line X but implemented as role on line Y".
-- 
Sterling Hanenkamp
http://sterling.hanenkamp.com/stfl/
785-370-4454