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

java.lang.IllegalStateException: unexpected psi: class org.jetbrains.kotlin.psi.KtProperty #248

Closed
yigit opened this issue Jan 12, 2021 · 0 comments · Fixed by #456
Closed
Assignees
Labels
bug Something isn't working P1 major features or blocking bugs
Milestone

Comments

@yigit
Copy link
Collaborator

yigit commented Jan 12, 2021

this is very similar to #164 and started happening after the 2021-01-11 update.

For the given input:

class JavaImpl implements MyInterface {
                public int getX() {
                    return 1;
                }
                public int getY() {
                    return 1;
                }
                public void setY(int value) {
                }
            }
interface MyInterface {
                val x:Int
                var y:Int
            }

calling findOverridee on setY of JavaImpl throws the following exception:

Caused by: java.lang.IllegalStateException: unexpected psi: class org.jetbrains.kotlin.psi.KtProperty
	at com.google.devtools.ksp.symbol.impl.UtilsKt.toKSFunctionDeclaration(utils.kt:267)
	at com.google.devtools.ksp.symbol.impl.java.KSFunctionDeclarationJavaImpl.findOverridee(KSFunctionDeclarationJavaImpl.kt:52)
	at androidx.room.compiler.processing.ksp.ResolverExtKt.overrides(ResolverExt.kt:82)
	at androidx.room.compiler.processing.ksp.ResolverExtKt.overrides(ResolverExt.kt:73)
copybara-service bot pushed a commit to androidx/androidx that referenced this issue Jan 13, 2021
This CL updates KSP to 20210111.
* Removed the fake checker impl since we don't need that anymore. KSP
skips fakes now.
* Re-enabled tests for java enums since that issue is fixed.
* Removed safeGetJvmName for properties because #200 is fixed.
Unfortunately, there is another bug for methods so we are still using
safeGet for them.
google/ksp#240
* Removed workaround in findOverridee but unfortunately, now we hit
another bug there: google/ksp#248

Bug: 160322705
Test: existing tests

Change-Id: Iddabe0a828821a13a20b8b23c7f9ad340893429b
@neetopia neetopia self-assigned this Jan 14, 2021
@neetopia neetopia added the bug Something isn't working label Jan 14, 2021
@ting-yuan ting-yuan added the P1 major features or blocking bugs label Mar 10, 2021
@ting-yuan ting-yuan added this to the 1.0.0 milestone Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 major features or blocking bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants