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: The type on destruct variable names is incorrect. #535

Open
traceyyoshima opened this issue Dec 12, 2023 · 0 comments
Labels
bug Something isn't working discovery Investigate and determine what should be done

Comments

@traceyyoshima
Copy link
Contributor

traceyyoshima commented Dec 12, 2023

The type on _ and adapter will be destruct instead of the defined variables. This likely only requires a slight revision to the parser visitor to call type on the correct elements. The issue occurs in visitDestructuringDeclarationEntry through createIdentifier and the PsiElementAssociation#primary method. IntelliJ assigns the correct types as String, so the information must be available but might occur in the IR instead of the FIR.

              fun foo(choices: List<Pair<String, String>>, peekedHeader: Regex) {
                  for ((_, adapter) in choices) {
                      if (adapter.matches(peekedHeader)) {
                          print("1")
                      }
                  }
              }
@traceyyoshima traceyyoshima added the bug Something isn't working label Dec 12, 2023
@traceyyoshima traceyyoshima self-assigned this Dec 12, 2023
@traceyyoshima traceyyoshima moved this to In Progress in OpenRewrite Dec 12, 2023
@traceyyoshima traceyyoshima moved this from In Progress to Backlog in OpenRewrite Dec 12, 2023
@traceyyoshima traceyyoshima removed their assignment Dec 14, 2023
@traceyyoshima traceyyoshima added the discovery Investigate and determine what should be done label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discovery Investigate and determine what should be done
Projects
Status: Backlog
Development

No branches or pull requests

1 participant