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


This works...

$ ./perl6 -e 'class A { my $.a; method m { say $.a } }'

...and this...

$ ./perl6 -e 'class A { has $!a; method m { say $!a } }'

...but not this...

$ perl6 -e 'say $.a'
error:imcc:syntax error, unexpected '\n', expecting '('
        in file 'EVAL_13' line 11
Could not find non-existent sub self
current instr.: '_block11' pc 11 (EVAL_13:11)
called from Sub 'parrot;PCT::HLLCompiler;eval' pc 806
(src/PCT/HLLCompiler.pir:481)
called from Sub 'parrot;PCT::HLLCompiler;command_line' pc 1305
(src/PCT/HLLCompiler.pir:708)
called from Sub 'parrot;Perl6::Compiler;main' pc 14567 (perl6.pir:172)

...nor this...

$ perl6 -e 'say $!a'
The opcode 'getattribute_p_ic_sc' (getattribute<3>) was not found.
Check the type and number of the arguments
current instr.: 'parrot;PCT::HLLCompiler;evalpmc' pc 744
(src/PCT/HLLCompiler.pir:448)
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 14567 (perl6.pir:172)

(Granted, they should throw errors, but errors related to using
attribute syntax outside of a class definition.)

This one could be made to work, but currently doesn't:

$ perl6 -e 'class A { my $.a; say $.a }'
error:imcc:syntax error, unexpected '\n', expecting '('
        in file 'EVAL_13' line 27
Could not find non-existent sub self
current instr.: 'parrot;A;_block22' pc 36 (EVAL_13:27)
called from Sub 'parrot;A;_block21' pc 25 (EVAL_13:18)
called from Sub 'parrot;PCT::HLLCompiler;evalpmc' pc 744
(src/PCT/HLLCompiler.pir:448)
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 14567 (perl6.pir:172)
perl6(27093) malloc: *** error for object 0x279c820: double free
*** set a breakpoint in malloc_error_break to debug
Segmentation fault

This one probably shouldn't work, but it shouldn't segfault either:

$ ./perl6 -e 'class A { has $.a; say $.a }'
error:imcc:syntax error, unexpected '\n', expecting '('
        in file 'EVAL_13' line 25
Could not find non-existent sub self
current instr.: 'parrot;A;_block23' pc 33 (EVAL_13:25)
called from Sub 'parrot;A;_block22' pc 25 (EVAL_13:18)
called from Sub 'parrot;PCT::HLLCompiler;evalpmc' pc 744
(src/PCT/HLLCompiler.pir:448)
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 14567 (perl6.pir:172)
perl6(27084) malloc: *** error for object 0x27c9640: double free
*** set a breakpoint in malloc_error_break to debug
Segmentation fault

Reply via email to