Skip to content

Remove bare array creation from multi assign#4824

Merged
RX14 merged 1 commit into
crystal-lang:masterfrom
RX14:feature/remove_auto_array
Aug 13, 2017
Merged

Remove bare array creation from multi assign#4824
RX14 merged 1 commit into
crystal-lang:masterfrom
RX14:feature/remove_auto_array

Conversation

@RX14
Copy link
Copy Markdown
Member

@RX14 RX14 commented Aug 12, 2017

Previously, a = 1, 2, 3 was parsed as a = [1, 2, 3]. This is a weird special case with strange side-effects such as a = 1, b = 2 being parsed as a = [1, b = 2] which is... not optimal. The previous statement can happen easily as a syntax error:

a = 1,
b = 2

This doesn't effect swapping expressions (a, foo.bar = foo.bar, 2) or destructuring (a, b, c = method()).

@ysbaddaden
Copy link
Copy Markdown
Collaborator

I agree. This is too much sugar.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants