# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #57230]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=57230 >


Using 'has' works in rakudo:

$ perl6 -e 'class A { has $.x; method foo { say $.x } }; my A $a .= new; $a.foo'
Object

But using 'my' (to create a class attribute as per S12:616) doesn't work:

$ perl6 -e 'class A { my $.x; method foo { say $.x } }; my A $a .= new; $a.foo'
Method 'isdecl' not found for invocant of class 'PAST::Op'
current instr.: 'parrot;Perl6;Grammar;Actions;scope_declarator' pc
114567 (src/gen_actions.pir:6314)
called from Sub 'parrot;Perl6::Grammar;scope_declarator' pc 78391
(src/gen_grammar.pir:22506)
called from Sub 'parrot;Perl6::Grammar;noun' pc 65170
(src/gen_grammar.pir:17871)
called from Sub 'parrot;Perl6::Grammar;expect_term' pc 60889
(src/gen_grammar.pir:16303)
called from Sub 'parrot;PGE::OPTable;parse' pc 1952
(compilers/pge/PGE/OPTable.pir:552)
called from Sub 'parrot;Perl6::Grammar;statement' pc 24039
(src/gen_grammar.pir:3115)
called from Sub 'parrot;Perl6::Grammar;statementlist' pc 22090
(src/gen_grammar.pir:2414)
called from Sub 'parrot;Perl6::Grammar;statement_block' pc 20057
(src/gen_grammar.pir:1650)
called from Sub 'parrot;Perl6::Grammar;block' pc 21246
(src/gen_grammar.pir:2093)
called from Sub 'parrot;Perl6::Grammar;package_block' pc 73685
(src/gen_grammar.pir:20852)
called from Sub 'parrot;Perl6::Grammar;package_def' pc 71519
(src/gen_grammar.pir:20104)
called from Sub 'parrot;Perl6::Grammar;package_declarator' pc 69737
(src/gen_grammar.pir:19493)
called from Sub 'parrot;Perl6::Grammar;noun' pc 65058
(src/gen_grammar.pir:17836)
called from Sub 'parrot;Perl6::Grammar;expect_term' pc 60889
(src/gen_grammar.pir:16303)
called from Sub 'parrot;PGE::OPTable;parse' pc 1952
(compilers/pge/PGE/OPTable.pir:552)
called from Sub 'parrot;Perl6::Grammar;statement' pc 24039
(src/gen_grammar.pir:3115)
called from Sub 'parrot;Perl6::Grammar;statementlist' pc 22090
(src/gen_grammar.pir:2414)
called from Sub 'parrot;Perl6::Grammar;statement_block' pc 20057
(src/gen_grammar.pir:1650)
called from Sub 'parrot;Perl6::Grammar;TOP' pc 16329 (src/gen_grammar.pir:224)
called from Sub 'parrot;PCT::HLLCompiler;parse' pc 585
(src/PCT/HLLCompiler.pir:371)
called from Sub 'parrot;PCT::HLLCompiler;compile' pc 438
(src/PCT/HLLCompiler.pir:303)
called from Sub 'parrot;PCT::HLLCompiler;eval' pc 776
(src/PCT/HLLCompiler.pir:473)
called from Sub 'parrot;PCT::HLLCompiler;command_line' pc 1305
(src/PCT/HLLCompiler.pir:708)
called from Sub 'parrot;Perl6::Compiler;main' pc 14518 (perl6.pir:172)

Reply via email to