-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Unexpected compile for paren-free method chaining #2035
Comments
This ticket is slightly different in that it shows the behavior is inconsistent when different arguments are passed to the first function, rather than proposing some chaining syntax. Whatever coffeescript does with chaining, it should act the same regardless of the type of arguments used. |
You're right that this is odd, but there is an explanation: The syntax
is special-cased to be an acceptable way of passing a hash to
is unacceptable. This necessarily leads to some quirks... I certainly agree that the inconsistency between your first two examples should be rectified, preferably by making the second one equivalent to the first. The excellent proposal at #1407 would accomplish that feat by making the |
Related, but not an actual cause. OP's first case works because dots right after OUTDENT is special-cased to close implicit calls. Observe:
|
Ah, good explanation, satyr. |
closing in favor of #1495 |
compiles to
But I'd expect example 2 to compile to the same thing as example 1, and example 3 to be
Is my assumption wrong?
The text was updated successfully, but these errors were encountered: