You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is, hopefully obviously, not an "unterminated parenthesized expression". The parentheses are very much terminated. The consequences of this error are wasting time trying to find a missing ) that isn't missing.
If you remove the space between Tuple and the parens after it the error goes away.
The text was updated successfully, but these errors were encountered:
masukomi
changed the title
Incorrect error message when extra whitespace present in tuple return statement
Incorrect error message when extra whitespace present in tuple return type annotation
Jun 13, 2018
I'm not sure this is a bug or whether it's worth fixing. This is valid syntax:
deffoo : Int321end
After a return type, the only thing that can come (apart from forall) is the method's body. So in your case, after Tuple (after the space) comes the body, which gives you the same syntax error as this:
Should def foo : Int32 1 end be valid Crystal? IMHO it looks a bit confusing and I don't know if avoiding a line break adds any value. Why not require a line break (or ;) between the method's signature and body?
This is, hopefully obviously, not an "unterminated parenthesized expression". The parentheses are very much terminated. The consequences of this error are wasting time trying to find a missing
)
that isn't missing.If you remove the space between
Tuple
and the parens after it the error goes away.Sample code here
Tested with
The text was updated successfully, but these errors were encountered: