Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'so $x = 1' causes weird errors #1580

Closed
p6rt opened this issue Mar 6, 2010 · 5 comments
Closed

'so $x = 1' causes weird errors #1580

p6rt opened this issue Mar 6, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Mar 6, 2010

Migrated from rt.perl.org#73352 (status was 'resolved')

Searchable as RT73352$

@p6rt
Copy link
Author

p6rt commented Mar 6, 2010

From @moritz

Rakudo 2d9808d19ba45c09f61a4c6fc4b4b7159ea760cc​:

$ cat foo.pl
my $x;
so $x = 1;

$ ./perl6 foo.pl
Cannot assign to readonly value
current instr.​: '&die' pc 16799 (src/builtins/Junction.pir​:347)
called from Sub '&infix​:<=>' pc 16623 (src/builtins/Junction.pir​:228)
called from Sub '_block14' pc 29 (EVAL_1​:0)
called from Sub '!UNIT_START' pc 1188 (src/glue/run.pir​:23)
called from Sub 'perl6;PCT;HLLCompiler;eval' pc -1 ((unknown file)​:-1)
called from Sub 'perl6;PCT;HLLCompiler;evalfiles' pc 1303
(compilers/pct/src/PCT/HLLCompiler.pir​:707)
called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1489
(compilers/pct/src/PCT/HLLCompiler.pir​:794)
called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file)​:-1)

I suspected a mis-parse, and look what I got for investigating​:

./perl6 --target=parse foo.pl
get_pmc_keyed() not implemented in class 'Undef'
current instr.​: 'perl6;Perl6;Grammar;assign_check' pc 152874
(src/gen/perl6-grammar.pir​:30593)
called from Sub 'perl6;HLL;Grammar;EXPR_reduce' pc 1423
(ext/nqp-rx/src/stage0/HLL-s0.pir​:711)
called from Sub 'perl6;HLL;Grammar;EXPR' pc 1016
(ext/nqp-rx/src/stage0/HLL-s0.pir​:552)
called from Sub 'perl6;Perl6;Grammar;statement' pc 44161
(src/gen/perl6-grammar.pir​:3214)
called from Sub 'perl6;Perl6;Grammar;statementlist' pc 43192
(src/gen/perl6-grammar.pir​:2925)
called from Sub 'perl6;Perl6;Grammar;comp_unit' pc 42746
(src/gen/perl6-grammar.pir​:2787)
called from Sub 'perl6;Perl6;Grammar;TOP' pc 33048 (src/gen/role_pm.pir​:783)
called from Sub 'perl6;Regex;Cursor;parse' pc 282
(ext/nqp-rx/src/stage0/Regex-s0.pir​:181)
called from Sub 'perl6;HLL;Compiler;parse' pc 5
(ext/nqp-rx/src/stage0/HLL-s0.pir​:24)
called from Sub 'perl6;PCT;HLLCompiler;compile' pc 388
(compilers/pct/src/PCT/HLLCompiler.pir​:287)
called from Sub 'perl6;PCT;HLLCompiler;eval' pc 992
(compilers/pct/src/PCT/HLLCompiler.pir​:556)
called from Sub 'perl6;PCT;HLLCompiler;evalfiles' pc 1303
(compilers/pct/src/PCT/HLLCompiler.pir​:707)
called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1489
(compilers/pct/src/PCT/HLLCompiler.pir​:794)
called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file)​:-1)

A test can be found in t/spec/S03-operators/precedence.t

--
Moritz Lenz
http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

From @coke

On Sat Mar 06 10​:12​:34 2010, mlenz@​physik.uni-wuerzburg.de wrote​:

Rakudo 2d9808d19ba45c09f61a4c6fc4b4b7159ea760cc​:

$ cat foo.pl
my $x;
so $x = 1;

$ ./perl6 foo.pl
Cannot assign to readonly value
current instr.​: '&die' pc 16799 (src/builtins/Junction.pir​:347)
called from Sub '&infix​:<=>' pc 16623 (src/builtins/Junction.pir​:228)
called from Sub '_block14' pc 29 (EVAL_1​:0)
called from Sub '!UNIT_START' pc 1188 (src/glue/run.pir​:23)
called from Sub 'perl6;PCT;HLLCompiler;eval' pc -1 ((unknown file)​:-1)
called from Sub 'perl6;PCT;HLLCompiler;evalfiles' pc 1303
(compilers/pct/src/PCT/HLLCompiler.pir​:707)
called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1489
(compilers/pct/src/PCT/HLLCompiler.pir​:794)
called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file)​:-1)

I suspected a mis-parse, and look what I got for investigating​:

./perl6 --target=parse foo.pl
get_pmc_keyed() not implemented in class 'Undef'
current instr.​: 'perl6;Perl6;Grammar;assign_check' pc 152874
(src/gen/perl6-grammar.pir​:30593)
called from Sub 'perl6;HLL;Grammar;EXPR_reduce' pc 1423
(ext/nqp-rx/src/stage0/HLL-s0.pir​:711)
called from Sub 'perl6;HLL;Grammar;EXPR' pc 1016
(ext/nqp-rx/src/stage0/HLL-s0.pir​:552)
called from Sub 'perl6;Perl6;Grammar;statement' pc 44161
(src/gen/perl6-grammar.pir​:3214)
called from Sub 'perl6;Perl6;Grammar;statementlist' pc 43192
(src/gen/perl6-grammar.pir​:2925)
called from Sub 'perl6;Perl6;Grammar;comp_unit' pc 42746
(src/gen/perl6-grammar.pir​:2787)
called from Sub 'perl6;Perl6;Grammar;TOP' pc 33048
(src/gen/role_pm.pir​:783)
called from Sub 'perl6;Regex;Cursor;parse' pc 282
(ext/nqp-rx/src/stage0/Regex-s0.pir​:181)
called from Sub 'perl6;HLL;Compiler;parse' pc 5
(ext/nqp-rx/src/stage0/HLL-s0.pir​:24)
called from Sub 'perl6;PCT;HLLCompiler;compile' pc 388
(compilers/pct/src/PCT/HLLCompiler.pir​:287)
called from Sub 'perl6;PCT;HLLCompiler;eval' pc 992
(compilers/pct/src/PCT/HLLCompiler.pir​:556)
called from Sub 'perl6;PCT;HLLCompiler;evalfiles' pc 1303
(compilers/pct/src/PCT/HLLCompiler.pir​:707)
called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1489
(compilers/pct/src/PCT/HLLCompiler.pir​:794)
called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file)​:-1)

A test can be found in t/spec/S03-operators/precedence.t

<Coke> rakudo​: my $x; so $x = 1; $x.say
<p6eval> rakudo 2808a5​: OUTPUT«1␤»

This seems to work, but I can't find the test mentioned above. assigning
to moritz for testing.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jul 28, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

From @moritz

Now tested in so.t

@p6rt
Copy link
Author

p6rt commented Jul 29, 2010

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jul 29, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant