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

[KSP2] Calling getDeclarationsInSourceOrder throws KotlinIllegalStateExceptionWithAttachments #1930

Closed
kuanyingchou opened this issue May 28, 2024 · 8 comments
Assignees
Labels
AA waiting for upstream fix bug Something isn't working
Milestone

Comments

@kuanyingchou
Copy link
Collaborator

This is another test case in XProcessing. Calling getDeclarationsInSourceOrder on a Java class implementing a Kotlin interface throws KotlinIllegalStateExceptionWithAttachments. If the sources are compiled then it works.

Repro: kuanyingchou@d4962e8

@neetopia neetopia self-assigned this May 28, 2024
@neetopia neetopia added this to the 2.1 milestone May 30, 2024
@neetopia neetopia added the bug Something isn't working label May 30, 2024
@neetopia
Copy link
Contributor

This issue appears to have been fixed, can you help me confirm?

@neetopia
Copy link
Contributor

maybe not, but I can't seem to reproduce the issue with your repro.

@kuanyingchou
Copy link
Collaborator Author

Oops, sorry I moved the files to a lib module to test compiled origins and forgot to move them back. I just tried the latest main and can still reproduce.

@neetopia neetopia added the AA waiting for upstream fix label Jun 12, 2024
@neetopia
Copy link
Contributor

created upstream issue for this: https://youtrack.jetbrains.com/issue/KT-69070

@neetopia
Copy link
Contributor

Simply removing this line seems to help: https://github.com/JetBrains/kotlin/blob/cff91084f650490747a650869cbf9e3e316f1e93/compiler/fir/providers/src/org/jetbrains/kotlin/fir/scopes/impl/FirFakeOverrideGenerator.kt#L668

on the other hand, in the debugger, at the exception site, the status of the fir symbol is in resolve phase of TYPE which caused the failure in check.

@kuanyingchou
Copy link
Collaborator Author

It seems that the Kotlin parent has to be generic. Here's another repro with declarations call:
kuanyingchou@9deb604

@ting-yuan
Copy link
Collaborator

The upstream issue was fixed last week and we are waiting for the next compiler update. build-2.1.0-dev-4693

@ting-yuan
Copy link
Collaborator

Verified with Kotlin 2.1.0-dev-5441.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AA waiting for upstream fix bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants