Fix absence of annotation for function type in cls stubs and ignore @ExtensionFunctionType
This commit is contained in:
+11
-4
@@ -92,10 +92,15 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
|
||||
val shouldBuildAsFunctionType = isNumberedFunctionClassFqName(classId.asSingleFqName().toUnsafe())
|
||||
&& type.argumentList.none { it.projection == Projection.STAR }
|
||||
if (shouldBuildAsFunctionType) {
|
||||
val extension = annotations.any { annotation ->
|
||||
annotation.asSingleFqName() == KotlinBuiltIns.FQ_NAMES.extensionFunctionType
|
||||
}
|
||||
createFunctionTypeStub(nullableTypeParent(parent, type), type, extension)
|
||||
val (extensionAnnotations, notExtensionAnnotations) =
|
||||
annotations.partition { it.asSingleFqName() == KotlinBuiltIns.FQ_NAMES.extensionFunctionType }
|
||||
|
||||
|
||||
createTypeAnnotationStubs(parent, notExtensionAnnotations)
|
||||
|
||||
val isExtension = extensionAnnotations.isNotEmpty()
|
||||
createFunctionTypeStub(nullableTypeParent(parent, type), type, isExtension)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -252,6 +257,8 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
|
||||
when (typeParameterProto.variance) {
|
||||
Variance.IN -> modifiers.add(KtTokens.IN_KEYWORD)
|
||||
Variance.OUT -> modifiers.add(KtTokens.OUT_KEYWORD)
|
||||
Variance.INV -> { /* do nothing */ }
|
||||
null -> { /* do nothing */ }
|
||||
}
|
||||
if (typeParameterProto.reified) {
|
||||
modifiers.add(KtTokens.REIFIED_KEYWORD)
|
||||
|
||||
Vendored
+2
-2
@@ -11,13 +11,13 @@ public class AnnotationsOnNullableTypes {
|
||||
|
||||
fun returnArgument(): B<@A C?> = null!!
|
||||
|
||||
val lambdaType: @A() (() -> C)? = null // TODO: Annotation is lost in stubs
|
||||
val lambdaType: @A() (() -> C)? = null
|
||||
|
||||
val lambdaParameter: (@A C?) -> C = null!!
|
||||
|
||||
val lambdaReturnValue: () -> @A C? = null!!
|
||||
|
||||
val lambdaReceiver: @A C.() -> C = null!! // TODO: Annotation is lost in stubs
|
||||
val lambdaReceiver: @A C.() -> C = null!!
|
||||
}
|
||||
|
||||
@Target(AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER)
|
||||
|
||||
Reference in New Issue
Block a user