[KAPT] Correct type for property with accessor
^KT-39060 Fixed
This commit is contained in:
+2
-2
@@ -1023,10 +1023,10 @@ class ClassFileToSourceStubConverter(val kaptContext: KaptContextForStubGenerati
|
|||||||
val returnType = getNonErrorType(
|
val returnType = getNonErrorType(
|
||||||
descriptor.returnType, RETURN_TYPE,
|
descriptor.returnType, RETURN_TYPE,
|
||||||
ktTypeProvider = {
|
ktTypeProvider = {
|
||||||
val element = kaptContext.origins[method]?.element
|
when (val element = kaptContext.origins[method]?.element) {
|
||||||
when (element) {
|
|
||||||
is KtFunction -> element.typeReference
|
is KtFunction -> element.typeReference
|
||||||
is KtProperty -> if (descriptor is PropertyGetterDescriptor) element.typeReference else null
|
is KtProperty -> if (descriptor is PropertyGetterDescriptor) element.typeReference else null
|
||||||
|
is KtPropertyAccessor -> if (descriptor is PropertyGetterDescriptor) element.property.typeReference else null
|
||||||
is KtParameter -> if (descriptor is PropertyGetterDescriptor) element.typeReference else null
|
is KtParameter -> if (descriptor is PropertyGetterDescriptor) element.typeReference else null
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ object NonExistentType {
|
|||||||
val b: List<ABCDEF>? = null
|
val b: List<ABCDEF>? = null
|
||||||
val c: (ABCDEF) -> Unit = { f -> }
|
val c: (ABCDEF) -> Unit = { f -> }
|
||||||
val d: ABCDEF<String, (List<ABCDEF>) -> Unit>? = null
|
val d: ABCDEF<String, (List<ABCDEF>) -> Unit>? = null
|
||||||
|
|
||||||
|
val foo: Foo get() = Foo()
|
||||||
|
|
||||||
fun a(a: ABCDEF, s: String): ABCDEF {}
|
fun a(a: ABCDEF, s: String): ABCDEF {}
|
||||||
fun b(s: String): ABCDEF {}
|
fun b(s: String): ABCDEF {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ public final class NonExistentType {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@org.jetbrains.annotations.NotNull()
|
||||||
|
public final Foo getFoo() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@org.jetbrains.annotations.NotNull()
|
@org.jetbrains.annotations.NotNull()
|
||||||
public final ABCDEF a(@org.jetbrains.annotations.NotNull()
|
public final ABCDEF a(@org.jetbrains.annotations.NotNull()
|
||||||
ABCDEF a, @org.jetbrains.annotations.NotNull()
|
ABCDEF a, @org.jetbrains.annotations.NotNull()
|
||||||
|
|||||||
Reference in New Issue
Block a user