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

Bad error message for block pass through with return statement #272

Closed
alex opened this Issue Aug 26, 2012 · 4 comments

Comments

Projects
None yet
4 participants
@alex
Copy link

alex commented Aug 26, 2012

alex@alex-gaynor-laptop:~/projects/rupypy$ ruby-1.9.3-p125 -e "return &5"
-e:1: block argument should not be given
alex@alex-gaynor-laptop:~/projects/rupypy$ jruby-1.6.7 -e "return &5"
SyntaxError: -e:1: Dynamic constant assignment.
@headius

This comment has been minimized.

Copy link
Member

headius commented Aug 27, 2012

Weird...must not be using the right message.

@alex

This comment has been minimized.

Copy link
Author

alex commented Aug 27, 2012

It comes from https://github.com/jruby/jruby/blob/master/src/org/jruby/parser/Ruby19Parser.y#L483 I believe, which means break and next almost certainly have the same issue.

@BanzaiMan

This comment has been minimized.

Copy link
Member

BanzaiMan commented Sep 2, 2013

There are a couple of places where the MRI parser checks for this condition (https://github.com/ruby/ruby/blob/v1_9_3_448/parse.y#L9017-L9023) but our parser doesn't have it.

enebo added a commit that referenced this issue Feb 6, 2014

@enebo enebo added this to the JRuby 1.7.11 milestone Feb 6, 2014

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Feb 6, 2014

Pretty funny it was just a typo in ret_args ...

@enebo enebo closed this Feb 6, 2014

eregon added a commit that referenced this issue Jul 18, 2016

Squashed 'spec/ruby/' changes from 9b80404..ced79c8
ced79c8 Remove spec depending on platform-dependent behavior from ungetc/lseek.
26689c1 Added Exception#cause spec
36f0116 Add a Hash spec
1a7edec Import specs extracted from Rubinius' merged Codedb ffi io branch
4c86731 [Truffle] Add rb_gc_register_address and rb_ary_new4.
9f34a94 [Truffle] Pass all cext complex specs.
51b1b08 [Truffle] Pass all cext rational specs.
ec7a0fe [Truffle] Pass all cext mutex specs.
e9cb231 [Truffle] Pass all cext float specs.
3bce77e [Truffle] Pass all cext fixnum specs.
a9bdd5b [Truffle] rb_gc_enable and _disable
064fdca Add sort_by! spec for single-element array.
440c00f [Truffle] Use jt cextc as the cext compiler.
b223b45 Add an example for Array#slice!
87a550a Add missing require in shared Range specs
be39236 Add a case for nil&.attr+=val to the safe navigation operator specs
cba3695 Merge pull request #274 from iliabylich/add-specs-for-safe-navigator
ffabc7f Add specs for a safe navigator.
0a65ffe Merge pull request #272 from wied03/def_specs
88343ce Test return value of defined setters and []= methods and multiple arguments provided.
8e65d52 Merge pull request #273 from jrafanie/add_2_3_tests_for_reject_bang
e68a19a Add specs for Array#reject!, delete_if 2.3 change
147b216 Merge pull request #271 from odaira/myContribution
d02b3ac Skip specs using getsockopt, which is known to return a wrong length in AIX
c9634e9 Add ensure to the begin/rescue/else permutations for rescue_spec
7e05c6d Prevent regression of outer scope return value with begin/else logic
e1f7b0d Test rescue begin/else on methods as well as blocks
d4ced96 feature guard for fork

git-subtree-dir: spec/ruby
git-subtree-split: ced79c84680f8a82e099eb14c164a57ce56b44b0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.