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

puts, p! methods raise compile error when omit the parenthesis #6573

Closed
TsumiNa opened this issue Aug 20, 2018 · 3 comments
Closed

puts, p! methods raise compile error when omit the parenthesis #6573

TsumiNa opened this issue Aug 20, 2018 · 3 comments

Comments

@TsumiNa
Copy link

TsumiNa commented Aug 20, 2018

Do something like this will get a compile error. https://play.crystal-lang.org/#/r/4s6z

p {1, 2}

#=> Syntax error in eval:1: unexpected token: ,Syntax error

Use parenthesis can fix it

p ({1, 2})

#=> {1, 2}

I'm not sure, but seems like a bug.

@asterite
Copy link
Member

No, this is how the language works. { after an identifier means passing a block to a method.

Duplicate of #4826 (and probably of many others).

@asterite
Copy link
Member

Duplicate of #2746
Duplicate of #1051

@TsumiNa
Copy link
Author

TsumiNa commented Aug 20, 2018

@asterite Clear enough! Thanks.

@TsumiNa TsumiNa closed this as completed Aug 20, 2018
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

2 participants