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] Comparing KSType leads to exception #1918

Closed
kuanyingchou opened this issue May 23, 2024 · 2 comments · Fixed by #2038
Closed

[KSP2] Comparing KSType leads to exception #1918

kuanyingchou opened this issue May 23, 2024 · 2 comments · Fixed by #2038
Assignees
Labels
AA waiting for upstream fix bug Something isn't working
Milestone

Comments

@kuanyingchou
Copy link
Collaborator

I got KotlinIllegalArgumentExceptionWithAttachments when comparing two KSTypes.

Here's a repro: kuanyingchou@9beb626

And the stackstrace:

org.jetbrains.kotlin.utils.exceptions.KotlinIllegalArgumentExceptionWithAttachments: Expected FirResolvedTypeRef with ConeKotlinType but was FirUserTypeRefImpl
	at app//org.jetbrains.kotlin.fir.types.FirTypeUtilsKt.getConeType(FirTypeUtils.kt:191)
	at app//org.jetbrains.kotlin.fir.types.ConeTypeContext.supertypes(ConeTypeContext.kt:293)
	at app//org.jetbrains.kotlin.types.AbstractNullabilityChecker.hasNotNullSupertype(AbstractTypeChecker.kt:878)
	at app//org.jetbrains.kotlin.types.AbstractNullabilityChecker.runIsPossibleSubtype(AbstractTypeChecker.kt:777)
	at app//org.jetbrains.kotlin.types.AbstractNullabilityChecker.isPossibleSubtype(AbstractTypeChecker.kt:734)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOfForSingleClassifierType(AbstractTypeChecker.kt:378)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.completeIsSubTypeOf(AbstractTypeChecker.kt:297)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOf(AbstractTypeChecker.kt:257)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOf$default(AbstractTypeChecker.kt:246)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeForSameConstructor(AbstractTypeChecker.kt:503)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOfForSingleClassifierType(AbstractTypeChecker.kt:406)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.completeIsSubTypeOf(AbstractTypeChecker.kt:297)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOf(AbstractTypeChecker.kt:257)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.isSubtypeOf$default(AbstractTypeChecker.kt:246)
	at app//org.jetbrains.kotlin.types.AbstractTypeChecker.equalTypes(AbstractTypeChecker.kt:276)
	at app//org.jetbrains.kotlin.analysis.api.fir.components.KtFirSubtypingComponent.isEqualTo(KtFirSubtypingComponent.kt:25)
	at app//org.jetbrains.kotlin.analysis.api.components.KtSubtypingComponentMixIn.isEqualTo(KtSubtypingComponent.kt:18)
	at app//com.google.devtools.ksp.impl.symbol.kotlin.KSTypeImpl.equals(KSTypeImpl.kt:154)
	at app//kotlin.jvm.internal.Intrinsics.areEqual(Intrinsics.java:169)
	at app//com.google.devtools.ksp.processor.ClassKindsProcessor.process(ClassKindsProcessor.kt:33)
	at app//com.google.devtools.ksp.impl.KotlinSymbolProcessing.execute(KotlinSymbolProcessing.kt:531)
	at app//com.google.devtools.ksp.test.AbstractKSPAATest.runTest(AbstractKSPAATest.kt:141)
	at app//com.google.devtools.ksp.test.AbstractKSPTest.runTest(AbstractKSPTest.kt:227)
	at app//com.google.devtools.ksp.test.KSPAATest.testClassKinds(KSPAATest.kt:153)
	at java.base@11.0.23/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base@11.0.23/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base@11.0.23/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base@11.0.23/java.lang.reflect.Method.invoke(Method.java:566)
	at app//org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
	at app//org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at app//org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at app//org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at app//org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at app//org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
	at app//org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at app//org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at app//org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at app//org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at app//org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at app//org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at app//org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at app//org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at app//org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
	at app//org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
	at app//org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at app//org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at app//org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:185)
	at app//org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService.invokeAll(ForkJoinPoolHierarchicalTestExecutorService.java:129)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at app//org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at app//org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:185)
	at app//org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService.invokeAll(ForkJoinPoolHierarchicalTestExecutorService.java:129)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at app//org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at app//org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at app//org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at app//org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:185)
	at java.base@11.0.23/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
	at java.base@11.0.23/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base@11.0.23/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base@11.0.23/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base@11.0.23/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base@11.0.23/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
@neetopia neetopia self-assigned this May 23, 2024
@neetopia neetopia added the bug Something isn't working label May 23, 2024
@neetopia neetopia added this to the 2.1 milestone May 30, 2024
@neetopia neetopia added the AA waiting for upstream fix label Jun 6, 2024
@neetopia
Copy link
Contributor

neetopia commented Jun 6, 2024

Looks like a bug in AA, reported to JB.

@neetopia
Copy link
Contributor

upstream issue for tracking: https://youtrack.jetbrains.com/issue/KT-68981

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

Successfully merging a pull request may close this issue.

2 participants