We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
According to: https://crystal-lang.org/docs/syntax_and_semantics/multiple_assignment.html
If the left-hand side contains just one variable, the right-hand side is considered an array: names = "John", "Peter", "Jack" The above is the same as: names = ["John", "Peter", "Jack"]
If the left-hand side contains just one variable, the right-hand side is considered an array: names = "John", "Peter", "Jack"
names = ["John", "Peter", "Jack"]
However, above code throws "Multiple assignment count mismatch" syntax error.
➜ ~ crystal test.cr Syntax error in test.cr:1: Multiple assignment count mismatch names = "John", "Peter", "Jack" ^
Is this intended behaviour in Crystal or the doc needs a update?
The text was updated successfully, but these errors were encountered:
It looks as though the spec doesn't allow for this behavior, suspect the docs are wrong at this point
crystal/spec/compiler/parser/parser_spec.cr
Line 145 in 322d1c4
Sorry, something went wrong.
Bare array creation was removed in 0.24.0 (see #4824). The language reference has not yet been updated.
No branches or pull requests
According to: https://crystal-lang.org/docs/syntax_and_semantics/multiple_assignment.html
However, above code throws "Multiple assignment count mismatch" syntax error.
Is this intended behaviour in Crystal or the doc needs a update?
The text was updated successfully, but these errors were encountered: