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

Wrong error message for something that shouldn't parse in Rakudo #1838

Closed
p6rt opened this issue Jun 15, 2010 · 5 comments
Closed

Wrong error message for something that shouldn't parse in Rakudo #1838

p6rt opened this issue Jun 15, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jun 15, 2010

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

Searchable as RT75776$

@p6rt
Copy link
Author

p6rt commented Jun 15, 2010

From @masak

<masak> rakudo​: my $d; class A {method x { $d }}; for () { sub }
<p6eval> rakudo 99b6dd​: OUTPUT«===SORRY!===␤Symbol '$ss_SS_S_S__S_S_s'
not predeclared [...]
<masak> locally, "Symbol '$d' not predeclared in <anonymous>"
* masak , honsetly confused, submits rakudobug
<masak> std​: my $d; class A {method x { $d }}; for () { sub }
<p6eval> std 31266​: OUTPUT«�===�SORRY!===␤Malformed block at [...]
class A {method x { $d }}; for () { sub⏏}␤expecting any of​:␤ name␤
routine_def␤trait␤Parse failed␤FAILED 00​:01 108m␤»

I don't know exactly why, but it seems that Rakudo, failing to realize
that the 'sub' thing in the for loop in fact constitutes a syntax
error, it instead blames the first innocent variable declaration it
finds.

@p6rt
Copy link
Author

p6rt commented Aug 18, 2010

@coke - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 10, 2011

From @coke

On Tue Jun 15 08​:37​:28 2010, masak wrote​:

<masak> rakudo​: my $d; class A {method x { $d }}; for () { sub }
<p6eval> rakudo 99b6dd​: OUTPUT«===SORRY!===␤Symbol '$ss_SS_S_S__S_S_s'
not predeclared [...]
<masak> locally, "Symbol '$d' not predeclared in <anonymous>"
* masak , honsetly confused, submits rakudobug
<masak> std​: my $d; class A {method x { $d }}; for () { sub }
<p6eval> std 31266​: OUTPUT«�===�SORRY!===␤Malformed block at [...]
class A {method x { $d }}; for () { sub⏏}␤expecting any of​:␤ name␤
routine_def␤trait␤Parse failed␤FAILED 00​:01 108m␤»

I don't know exactly why, but it seems that Rakudo, failing to realize
that the 'sub' thing in the for loop in fact constitutes a syntax
error, it instead blames the first innocent variable declaration it
finds.

Now, more like std​:

19​:25 < [Coke]> rakudo​: my $d; class A {method x { $d }}; for () { sub }
19​:26 <+p6eval> rakudo 38907e​: OUTPUT«===SORRY!===␤Missing block at line 1,
  near "}"␤»

Closable with tests.
--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 7, 2012

From @moritz

Now tested in S32-exceptions/misc.t

@p6rt
Copy link
Author

p6rt commented Aug 7, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant