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

Allow constants and instance / class variables as receivers for setter proc pointers #10741

Merged

Conversation

HertzDevil
Copy link
Contributor

Currently, the following proc pointers are allowed:

->foo=(Int32)   # implicit receiver
->x.foo=(Int32) # `x` is a variable

This PR adds support for the following proc pointers, which currently produce Error: unexpected token: =:

->Foo.foo=(Int32)   # path (type or constant)
->@foo.foo=(Int32)  # instance variables
->@@foo.foo=(Int32) # class variables

Operators that end with =, most notably []=, are unaffected as they are already supported (as long as there is a receiver).

@straight-shoota straight-shoota added this to the 1.2.0 milestone Jun 29, 2021
@straight-shoota straight-shoota merged commit f2168b1 into crystal-lang:master Jul 23, 2021
@HertzDevil HertzDevil deleted the bug/setter-proc-pointers branch July 23, 2021 16:51
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

3 participants