Skip to content

Commit

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

override fun process(resolver: Resolver): List<KSAnnotated> {

resolver.getClassDeclarationByName("StyleBuilder")!!.let { cls ->
val typeOne = cls.asType(emptyList())
val typeTwo = cls.asType(emptyList())
println(typeOne == typeTwo)
}

fun KSClassDeclaration.pretty(): String = "${qualifiedName!!.asString()}: $classKind"
val files = resolver.getNewFiles()
files.forEach {
Expand Down
15 changes: 14 additions & 1 deletion test-utils/testData/api/classKinds.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,20 @@
// kotlin.DeprecationLevel: ENUM_CLASS
// kotlin.Double.Companion: OBJECT
// END

// FILE: A.kt
class StyleApplier<X, Y>
class StyleBuilder<out B : StyleBuilder<B, A>, out A : StyleApplier<*, *>>
class KotlinSubject {
fun subject_1(builder: StyleBuilder<*, *>) {
}
}
// FILE: B.java
public class JavaSubject {
static void subject_1(StyleBuilder<?, ?> builder) {
}
static void subject_2(StyleBuilder builder) {
}
}
// FILE: K.kt
class KC
interface KI
Expand Down

0 comments on commit 9beb626

Please sign in to comment.