Kapt: asMemberOf() should also check the containing type itself, not only its supertypes (KT-13823)
(cherry picked from commit 9f9ffdf)
This commit is contained in:
committed by
Yan Zhulanow
parent
cb9dc21649
commit
415acfbd05
+5
@@ -263,8 +263,10 @@ class ProcessorTests : AbstractProcessorTest() {
|
||||
val fType = f.asType() as JeDeclaredType
|
||||
|
||||
val base = env.findClass("Base")
|
||||
val impl = env.findClass("Impl")
|
||||
val baseF = base.findField("f")
|
||||
val baseM = base.findMethod("m", "T")
|
||||
val implM = impl.findMethod("implM", "T")
|
||||
|
||||
fun check(element: Element, expectedTypeSignature: String) {
|
||||
assertEquals(expectedTypeSignature, env.typeUtils.asMemberOf(fType, element).toString())
|
||||
@@ -275,6 +277,9 @@ class ProcessorTests : AbstractProcessorTest() {
|
||||
|
||||
assertEquals("T", baseF.asType().toString())
|
||||
check(baseF, "java.lang.String")
|
||||
|
||||
assertEquals("(T)T", implM.asType().toString())
|
||||
check(implM, "(java.lang.String)java.lang.String")
|
||||
}
|
||||
|
||||
fun testDispose() {
|
||||
|
||||
Reference in New Issue
Block a user