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: support calls in assignments #110

Closed
wants to merge 1 commit into from

Conversation

emjin
Copy link

@emjin emjin commented Nov 22, 2023

In Kotlin, we can write code like:

package annotation.test

public object Test {
    fun f1(context : Context) {
        Foo(context).elem = var1
    }
}

where Foo(context).elem = var1 assigns var1 to an object constructed in that line.

More generally, the result of calls can be shared objects that we wish to assign to. Therefore, expressions that can be on the left hand of assignments (primary expressions) need to include calls.

Test plan: parse the example given

In Kotlin, we can write code like:

```
package annotation.test

public object Test {
    fun f1(context : Context) {
        Foo(context).elem = var1
    }
}
```

where `Foo(context).elem = var1` assigns `var1` to an object constructed
in that line.

More generally, the result of calls can be shared objects that we wish
to assign to. Therefore, expressions that can be on the left hand of
assignments (primary expressions) need to include calls.

Test plan: parse the example given
@github-actions github-actions bot added the grammar Related to the grammar label Nov 22, 2023
@emjin emjin closed this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grammar Related to the grammar
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant