diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java index 7161265a47e..176ee5004b6 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/Fir2IrTextTestGenerated.java @@ -2314,6 +2314,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/firProblems/throwableStackTrace.kt"); } + @Test + @TestMetadata("TypeParameterBounds.kt") + public void testTypeParameterBounds() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt"); + } + @Test @TestMetadata("typeParameterFromJavaClass.kt") public void testTypeParameterFromJavaClass() throws Exception { diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeUtils.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeUtils.kt index fa9fc5fd62c..c0e36bb7802 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeUtils.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeUtils.kt @@ -115,11 +115,13 @@ fun List.computeTypeAttributes( CompilerConeAttributes.ExtensionFunctionType.ANNOTATION_CLASS_ID -> attributes += CompilerConeAttributes.ExtensionFunctionType CompilerConeAttributes.UnsafeVariance.ANNOTATION_CLASS_ID -> attributes += CompilerConeAttributes.UnsafeVariance else -> { - if (classId.startsWith(StandardClassIds.BASE_KOTLIN_PACKAGE.shortName())) { - // The check ^ is intended to leave only annotations which may be important for BE + val annotationAttributes = mutableListOf>() + additionalProcessor.invoke(annotationAttributes, classId) + if (annotationAttributes.isEmpty()) { customAnnotations += annotation + } else { + attributes += annotationAttributes } - additionalProcessor.invoke(attributes, classId) } } } diff --git a/compiler/testData/codegen/box/annotations/typeAnnotations/classTypeParameterBoundsJava.kt b/compiler/testData/codegen/box/annotations/typeAnnotations/classTypeParameterBoundsJava.kt index 633f930e5fd..821908f9205 100644 --- a/compiler/testData/codegen/box/annotations/typeAnnotations/classTypeParameterBoundsJava.kt +++ b/compiler/testData/codegen/box/annotations/typeAnnotations/classTypeParameterBoundsJava.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: JVM // IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // EMIT_JVM_TYPE_ANNOTATIONS // !LANGUAGE: +ClassTypeParameterAnnotations diff --git a/compiler/testData/codegen/box/annotations/typeAnnotations/methodTypeParameters.kt b/compiler/testData/codegen/box/annotations/typeAnnotations/methodTypeParameters.kt index 1de17e4272e..1cb4691b912 100644 --- a/compiler/testData/codegen/box/annotations/typeAnnotations/methodTypeParameters.kt +++ b/compiler/testData/codegen/box/annotations/typeAnnotations/methodTypeParameters.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND: JVM // IGNORE_LIGHT_ANALYSIS -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // EMIT_JVM_TYPE_ANNOTATIONS // JVM_TARGET: 1.8 diff --git a/compiler/testData/ir/irText/classes/kt43217.fir.txt b/compiler/testData/ir/irText/classes/kt43217.fir.txt index 2e01ec3f112..5b0e8f44fe7 100644 --- a/compiler/testData/ir/irText/classes/kt43217.fir.txt +++ b/compiler/testData/ir/irText/classes/kt43217.fir.txt @@ -22,12 +22,12 @@ FILE fqName: fileName:/kt43217.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (): kotlin.Double [operator] declared in .A.b.' CONST Double type=kotlin.Double value=0.0 - FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] @[Override] kotlin.Any [fake_override] annotations: NotNull(value = ) Override overridden: - public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] kotlin.Any declared in .DoubleExpression + public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] @[Override] kotlin.Any declared in .DoubleExpression $this: VALUE_PARAMETER name: type:.DoubleExpression VALUE_PARAMETER name:value index:0 type:kotlin.Double FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -77,12 +77,12 @@ FILE fqName: fileName:/kt43217.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (): kotlin.Double [operator] declared in .C' CONST Double type=kotlin.Double value=0.0 - FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] + FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] @[Override] kotlin.Any [fake_override] annotations: NotNull(value = ) Override overridden: - public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] kotlin.Any declared in .DoubleExpression + public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] @[Override] kotlin.Any declared in .DoubleExpression $this: VALUE_PARAMETER name: type:.DoubleExpression VALUE_PARAMETER name:value index:0 type:kotlin.Double FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt new file mode 100644 index 00000000000..750c4eeefb7 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt @@ -0,0 +1,29 @@ +// FIR_IDENTICAL +// !LANGUAGE: +ClassTypeParameterAnnotations + +@Target(AnnotationTarget.TYPE) +annotation class TypeAnn(val name: String) + +@Target(AnnotationTarget.TYPE_PARAMETER) +annotation class TypeParameterAnn + +@Target(AnnotationTarget.TYPE_PARAMETER) +@Retention(AnnotationRetention.BINARY) +annotation class TypeParameterAnnBinary + +interface Simple +class SimpleClass +interface Generic +class GenericClass + +class SimpleParameter<@TypeParameterAnn @TypeParameterAnnBinary T> {} + +class InterfaceBound<@TypeParameterAnn T : @TypeAnn("Simple") Simple> {} + +class ClassBound<@TypeParameterAnn T : @TypeAnn("Simple") SimpleClass> + +class InterfaceBoundGeneric> {} + +class ClassBoundGeneric> + +class TypeParameterAsBound diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt.txt b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt.txt new file mode 100644 index 00000000000..42ca3c35d2d --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt.txt @@ -0,0 +1,101 @@ +@Target(allowedTargets = [AnnotationTarget.TYPE]) +annotation class TypeAnn : Annotation { + constructor(name: String) /* primary */ + val name: String + field = name + get + +} + +@Target(allowedTargets = [AnnotationTarget.TYPE_PARAMETER]) +annotation class TypeParameterAnn : Annotation { + constructor() /* primary */ + +} + +@Target(allowedTargets = [AnnotationTarget.TYPE_PARAMETER]) +@Retention(value = AnnotationRetention.BINARY) +annotation class TypeParameterAnnBinary : Annotation { + constructor() /* primary */ + +} + +interface Simple { + +} + +class SimpleClass { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +interface Generic { + +} + +class GenericClass { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class SimpleParameter<@TypeParameterAnn @TypeParameterAnnBinary T : Any?> { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class InterfaceBound<@TypeParameterAnn T : @TypeAnn(name = "Simple") Simple> { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class ClassBound<@TypeParameterAnn T : @TypeAnn(name = "Simple") SimpleClass> { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class InterfaceBoundGeneric> { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class ClassBoundGeneric> { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} + +class TypeParameterAsBound { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + +} diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterBounds.txt b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.txt new file mode 100644 index 00000000000..37acc90b254 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/TypeParameterBounds.txt @@ -0,0 +1,268 @@ +FILE fqName: fileName:/TypeParameterBounds.kt + CLASS ANNOTATION_CLASS name:TypeAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeAnn + CONSTRUCTOR visibility:public <> (name:kotlin.String) returnType:.TypeAnn [primary] + VALUE_PARAMETER name:name index:0 type:kotlin.String + PROPERTY name:name visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'name: kotlin.String declared in .TypeAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TypeAnn) returnType:kotlin.String + correspondingProperty: PROPERTY name:name visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TypeAnn + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TypeAnn' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .TypeAnn declared in .TypeAnn.' type=.TypeAnn origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:TypeParameterAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE_PARAMETER' type=kotlin.annotation.AnnotationTarget]) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeParameterAnn + CONSTRUCTOR visibility:public <> () returnType:.TypeParameterAnn [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS ANNOTATION_CLASS name:TypeParameterAnnBinary modality:FINAL visibility:public superTypes:[kotlin.Annotation] + annotations: + Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE_PARAMETER' type=kotlin.annotation.AnnotationTarget]) + Retention(value = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:BINARY' type=kotlin.annotation.AnnotationRetention) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeParameterAnnBinary + CONSTRUCTOR visibility:public <> () returnType:.TypeParameterAnnBinary [primary] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in kotlin.Annotation + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Simple modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Simple + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:SimpleClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SimpleClass + CONSTRUCTOR visibility:public <> () returnType:.SimpleClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SimpleClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:Generic modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Generic.Generic> + TYPE_PARAMETER name:G index:0 variance: superTypes:[kotlin.Any?] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:GenericClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.GenericClass.GenericClass> + TYPE_PARAMETER name:G index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.GenericClass.GenericClass> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:GenericClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:SimpleParameter modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SimpleParameter.SimpleParameter> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + annotations: + TypeParameterAnn + TypeParameterAnnBinary + CONSTRUCTOR visibility:public <> () returnType:.SimpleParameter.SimpleParameter> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SimpleParameter modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:InterfaceBound modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InterfaceBound.InterfaceBound> + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = 'Simple')] .Simple] + annotations: + TypeParameterAnn + CONSTRUCTOR visibility:public <> () returnType:.InterfaceBound.InterfaceBound> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InterfaceBound modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:ClassBound modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClassBound.ClassBound> + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = 'Simple')] .SimpleClass] + annotations: + TypeParameterAnn + CONSTRUCTOR visibility:public <> () returnType:.ClassBound.ClassBound> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClassBound modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:InterfaceBoundGeneric modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InterfaceBoundGeneric.InterfaceBoundGeneric> + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = 'Generic')] .Generic<@[TypeAnn(name = 'Simple')] .Simple>] + CONSTRUCTOR visibility:public <> () returnType:.InterfaceBoundGeneric.InterfaceBoundGeneric> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InterfaceBoundGeneric modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:ClassBoundGeneric modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ClassBoundGeneric.ClassBoundGeneric> + TYPE_PARAMETER name:T index:0 variance: superTypes:[@[TypeAnn(name = 'GenericClass')] .GenericClass<@[TypeAnn(name = 'SimpleClass')] .SimpleClass>] + CONSTRUCTOR visibility:public <> () returnType:.ClassBoundGeneric.ClassBoundGeneric> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClassBoundGeneric modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:TypeParameterAsBound modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TypeParameterAsBound.TypeParameterAsBound, T of .TypeParameterAsBound> + TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:T index:1 variance: superTypes:[@[TypeAnn(name = 'Y as Bound')] Y of .TypeParameterAsBound] + annotations: + TypeParameterAnn + CONSTRUCTOR visibility:public <> () returnType:.TypeParameterAsBound.TypeParameterAsBound, T of .TypeParameterAsBound> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TypeParameterAsBound modality:FINAL visibility:public superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java index f6647e8994b..2ff19e04bd8 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/IrTextTestGenerated.java @@ -2314,6 +2314,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest { runTest("compiler/testData/ir/irText/firProblems/throwableStackTrace.kt"); } + @Test + @TestMetadata("TypeParameterBounds.kt") + public void testTypeParameterBounds() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/TypeParameterBounds.kt"); + } + @Test @TestMetadata("typeParameterFromJavaClass.kt") public void testTypeParameterFromJavaClass() throws Exception {