Skip to content

Commit

Permalink
Test error type
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanyingchou committed May 24, 2024
1 parent cdf8f1c commit eb7d4fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ open class ClassKindsProcessor : AbstractTestProcessor() {
val results = mutableListOf<String>()

override fun process(resolver: Resolver): List<KSAnnotated> {
resolver.getClassDeclarationByName("Bar")!!.let { cls ->
val errorType = cls.superTypes.single().resolve()
println(errorType)
println(errorType.replace(errorType.arguments))
}
fun KSClassDeclaration.pretty(): String = "${qualifiedName!!.asString()}: $classKind"
val files = resolver.getNewFiles()
files.forEach {
Expand Down
4 changes: 3 additions & 1 deletion test-utils/testData/api/classKinds.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
// kotlin.DeprecationLevel: ENUM_CLASS
// kotlin.Double.Companion: OBJECT
// END

// FILE: Test.java
class Bar extends Foo<MissingType> {}
class Foo<T> {}
// FILE: K.kt
class KC
interface KI
Expand Down

0 comments on commit eb7d4fe

Please sign in to comment.