Skip to content

Remove support for sending messages to binary expressions using a newline

Yorick Peterse requested to merge remove-binary-newline-send into master

This removes syntax support for sending messages to the result of a binary expression without using parentheses. In other words, this:

foo == bar
  .something

Is no longer parsed as (foo == bar).something, instead it is not parsed as foo == bar.something. To send a message to the result you need to use parentheses:

(foo == bar).something

This might be a bit more verbose, but it makes the syntax easier to parse for both humans and computers. It also makes it possible to spread the right-hand side over multiple lines when necessary. For example, prior to this MR this would not work as expected:

foo == 
  bar
    .baz
    .quix

This would be parsed as (foo == bar).baz.quix, and not (foo == bar.baz.quix).

Merge request reports