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

Fix to work formatting foo.[bar] = baz #5424

Conversation

makenowjust
Copy link
Contributor

Fixed #5416

@RX14
Copy link
Contributor

RX14 commented Dec 21, 2017

I'm not sure we should allow reciever.[foo] = bar. Is there any reason not to enforce reciever[foo] = bar? I assume they're the exact same thing.

@makenowjust
Copy link
Contributor Author

makenowjust commented Dec 21, 2017

We should allow this because it is needed to write an assignment with multiline call chaining:

foo
  .bar_method(...)
  .baz_method(...)
  .[foobar] = baz

And also we can't enforce foo[bar] = baz always for this reason.

Copy link
Contributor

@RX14 RX14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks

Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! But it needs a rebase.

@makenowjust makenowjust force-pushed the fix/crystal-format/work-dot-bracket-equal branch from 6c503f9 to 4702bd8 Compare January 10, 2018 14:23
@makenowjust
Copy link
Contributor Author

rebased

@makenowjust makenowjust force-pushed the fix/crystal-format/work-dot-bracket-equal branch from 4702bd8 to f9483c2 Compare January 10, 2018 14:31
@asterite asterite merged commit 972f2b3 into crystal-lang:master Jan 10, 2018
@asterite asterite added this to the Next milestone Jan 10, 2018
@makenowjust makenowjust deleted the fix/crystal-format/work-dot-bracket-equal branch January 10, 2018 15:04
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.

None yet

4 participants