Fix annotation class modality in stubs
^KT-49428
This commit is contained in:
@@ -244,6 +244,14 @@ abstract class DeclarationStubGenerator(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// in IR Generator enums also have special handling, but here we have not enough data for it
|
||||||
|
// probably, that is not a problem, because you can't add new enum value to external module
|
||||||
|
private fun getEffectiveModality(classDescriptor: ClassDescriptor): Modality =
|
||||||
|
if (DescriptorUtils.isAnnotationClass(classDescriptor))
|
||||||
|
Modality.OPEN
|
||||||
|
else
|
||||||
|
classDescriptor.modality
|
||||||
|
|
||||||
fun generateClassStub(descriptor: ClassDescriptor): IrClass {
|
fun generateClassStub(descriptor: ClassDescriptor): IrClass {
|
||||||
val referenceClass = symbolTable.referenceClass(descriptor)
|
val referenceClass = symbolTable.referenceClass(descriptor)
|
||||||
if (referenceClass.isBound) {
|
if (referenceClass.isBound) {
|
||||||
@@ -254,7 +262,7 @@ abstract class DeclarationStubGenerator(
|
|||||||
IrLazyClass(
|
IrLazyClass(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
|
||||||
it, descriptor,
|
it, descriptor,
|
||||||
descriptor.name, descriptor.kind, descriptor.visibility, descriptor.modality,
|
descriptor.name, descriptor.kind, descriptor.visibility, getEffectiveModality(descriptor),
|
||||||
isCompanion = descriptor.isCompanionObject,
|
isCompanion = descriptor.isCompanionObject,
|
||||||
isInner = descriptor.isInner,
|
isInner = descriptor.isInner,
|
||||||
isData = descriptor.isData,
|
isData = descriptor.isData,
|
||||||
|
|||||||
+1
-1
@@ -181,7 +181,7 @@ FILE fqName:<root> fileName:/kt45236.kt
|
|||||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
FUN name:isError visibility:public modality:FINAL <T> ($receiver:<root>.NetRequestStatus<T of <root>.isError>) returnType:kotlin.Boolean
|
FUN name:isError visibility:public modality:FINAL <T> ($receiver:<root>.NetRequestStatus<T of <root>.isError>) returnType:kotlin.Boolean
|
||||||
annotations:
|
annotations:
|
||||||
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalContracts modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.contracts.ExperimentalContracts>])
|
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalContracts modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.contracts.ExperimentalContracts>])
|
||||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any]
|
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any]
|
||||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.NetRequestStatus<T of <root>.isError>
|
$receiver: VALUE_PARAMETER name:<this> type:<root>.NetRequestStatus<T of <root>.isError>
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
|
FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
|
||||||
FUN name:scopedFlow visibility:public modality:FINAL <R> (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<<root>.CoroutineScope, <root>.FlowCollector<R of <root>.scopedFlow>, kotlin.Unit>) returnType:<root>.Flow<R of <root>.scopedFlow>
|
FUN name:scopedFlow visibility:public modality:FINAL <R> (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<<root>.CoroutineScope, <root>.FlowCollector<R of <root>.scopedFlow>, kotlin.Unit>) returnType:<root>.Flow<R of <root>.scopedFlow>
|
||||||
annotations:
|
annotations:
|
||||||
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
||||||
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?]
|
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?]
|
||||||
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<<root>.CoroutineScope, <root>.FlowCollector<R of <root>.scopedFlow>, kotlin.Unit>
|
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction2<<root>.CoroutineScope, <root>.FlowCollector<R of <root>.scopedFlow>, kotlin.Unit>
|
||||||
annotations:
|
annotations:
|
||||||
@@ -53,7 +53,7 @@ FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
|
|||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
FUN name:unsafeFlow visibility:public modality:FINAL <T> (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.FlowCollector<T of <root>.unsafeFlow>, kotlin.Unit>) returnType:<root>.Flow<T of <root>.unsafeFlow> [inline]
|
FUN name:unsafeFlow visibility:public modality:FINAL <T> (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.FlowCollector<T of <root>.unsafeFlow>, kotlin.Unit>) returnType:<root>.Flow<T of <root>.unsafeFlow> [inline]
|
||||||
annotations:
|
annotations:
|
||||||
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
||||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
|
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
|
||||||
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.FlowCollector<T of <root>.unsafeFlow>, kotlin.Unit> [crossinline]
|
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.FlowCollector<T of <root>.unsafeFlow>, kotlin.Unit> [crossinline]
|
||||||
annotations:
|
annotations:
|
||||||
@@ -193,7 +193,7 @@ FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
|
|||||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
FUN name:flow visibility:public modality:FINAL <T> (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.FlowCollector<T of <root>.flow>, kotlin.Unit>) returnType:<root>.Flow<T of <root>.flow>
|
FUN name:flow visibility:public modality:FINAL <T> (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.FlowCollector<T of <root>.flow>, kotlin.Unit>) returnType:<root>.Flow<T of <root>.flow>
|
||||||
annotations:
|
annotations:
|
||||||
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
||||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
|
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
|
||||||
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.FlowCollector<T of <root>.flow>, kotlin.Unit>
|
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.FlowCollector<T of <root>.flow>, kotlin.Unit>
|
||||||
annotations:
|
annotations:
|
||||||
@@ -203,7 +203,7 @@ FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
|
|||||||
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin.StandardKt' type=kotlin.Nothing origin=null
|
||||||
FUN name:flowScope visibility:public modality:FINAL <R> (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.CoroutineScope, R of <root>.flowScope>) returnType:R of <root>.flowScope [suspend]
|
FUN name:flowScope visibility:public modality:FINAL <R> (block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.CoroutineScope, R of <root>.flowScope>) returnType:R of <root>.flowScope [suspend]
|
||||||
annotations:
|
annotations:
|
||||||
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
||||||
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?]
|
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?]
|
||||||
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.CoroutineScope, R of <root>.flowScope>
|
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.CoroutineScope, R of <root>.flowScope>
|
||||||
annotations:
|
annotations:
|
||||||
@@ -311,7 +311,7 @@ FILE fqName:<root> fileName:/castsInsideCoroutineInference.kt
|
|||||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
FUN name:produce visibility:public modality:FINAL <E> ($receiver:<root>.CoroutineScope, block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.ProducerScope<E of <root>.produce>, kotlin.Unit>) returnType:<root>.ReceiveChannel<E of <root>.produce>
|
FUN name:produce visibility:public modality:FINAL <E> ($receiver:<root>.CoroutineScope, block:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.ProducerScope<E of <root>.produce>, kotlin.Unit>) returnType:<root>.ReceiveChannel<E of <root>.produce>
|
||||||
annotations:
|
annotations:
|
||||||
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:FINAL visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalTypeInference modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass<kotlin.experimental.ExperimentalTypeInference>])
|
||||||
TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?]
|
TYPE_PARAMETER name:E index:0 variance: superTypes:[kotlin.Any?]
|
||||||
$receiver: VALUE_PARAMETER name:<this> type:<root>.CoroutineScope
|
$receiver: VALUE_PARAMETER name:<this> type:<root>.CoroutineScope
|
||||||
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.ProducerScope<E of <root>.produce>, kotlin.Unit>
|
VALUE_PARAMETER name:block index:0 type:@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1<<root>.ProducerScope<E of <root>.produce>, kotlin.Unit>
|
||||||
|
|||||||
Reference in New Issue
Block a user