Important Notice
Describe the bug
querydsl-ksp-codegen:7.1 crashes with IllegalStateException when processing MongoDB @document classes that have ObjectId fields.
To Reproduce
- Create a Spring Data MongoDB @document class with an ObjectId field
- Add querydsl-ksp-codegen to build.gradle.kts
- Run ./gradlew kspKotlin
Expected behavior
KSP processor should generate QAgent.kt query class.
Actual behavior
Build fails with: IllegalStateException: KSType 'Comparable<(ObjectId..ObjectId?)>' has type arguments
Root cause
In TypeExtractor.kt:69, fallbackType() calls toClassName() on Comparable without checking if it is parameterized.
Proposed fix
Skip supertypes with type arguments before calling toClassName():
declaration.getAllSuperTypes().any { supertype ->
supertype.arguments.isEmpty() && comparableNames.contains(supertype.toClassName().canonicalName)
}
Environment
- OS: Linux
- Kotlin: 2.3.20
- querydsl-ksp-codegen: 7.1
- kotlinpoet-ksp: 2.2.0
Important Notice
Describe the bug
querydsl-ksp-codegen:7.1 crashes with IllegalStateException when processing MongoDB @document classes that have ObjectId fields.
To Reproduce
Expected behavior
KSP processor should generate QAgent.kt query class.
Actual behavior
Build fails with: IllegalStateException: KSType 'Comparable<(ObjectId..ObjectId?)>' has type arguments
Root cause
In TypeExtractor.kt:69, fallbackType() calls toClassName() on Comparable without checking if it is parameterized.
Proposed fix
Skip supertypes with type arguments before calling toClassName():
declaration.getAllSuperTypes().any { supertype -> supertype.arguments.isEmpty() && comparableNames.contains(supertype.toClassName().canonicalName) }Environment