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

PSI association issue: type attributable labels are missing types. #539

Open
traceyyoshima opened this issue Dec 13, 2023 · 1 comment
Open
Labels
discovery Investigate and determine what should be done parser-kotlin

Comments

@traceyyoshima
Copy link
Contributor

Discovered by type assertions.
The PSI element association includes various FIR elements, including a reference to the anonymous function. Note: this mis-mapping applies to all labels that may be type-attributed.

              fun foo(ints: List<Int>) {
                  ints.forEach {
                      if (it == 0) return@forEach
                      print(it)
                  }
              }
@traceyyoshima traceyyoshima added the bug Something isn't working label Dec 13, 2023
@traceyyoshima traceyyoshima self-assigned this Dec 13, 2023
@traceyyoshima traceyyoshima moved this to Backlog in OpenRewrite Dec 13, 2023
@traceyyoshima traceyyoshima moved this from Backlog to In Progress in OpenRewrite Dec 13, 2023
@traceyyoshima traceyyoshima moved this from In Progress to Backlog in OpenRewrite Dec 13, 2023
@traceyyoshima traceyyoshima added discovery Investigate and determine what should be done and removed bug Something isn't working labels Dec 13, 2023
@traceyyoshima
Copy link
Contributor Author

Note: This may be simpler using the IR. There isn't a PSI element associated with the FIR elements label field since the PSI on the label is the labeled element.

              fun foo(ints: List<Int>) {
                  ints.forEach {
                      if (it == 0) return@forEach // The PSI element on the FIR's label to `forEach` is the `forEach` a select of `ints`.
                      print(it)
                  }
              }

@traceyyoshima traceyyoshima removed their assignment Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discovery Investigate and determine what should be done parser-kotlin
Projects
Status: Backlog
Development

No branches or pull requests

1 participant