From f3bc8d179ce57c266410b2b3c3f35625d308c6b4 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 16 Mar 2018 12:52:05 +0300 Subject: [PATCH] Add one more IR text test case --- .../typeParameterBoundedBySubclass.kt | 7 ++ .../typeParameterBoundedBySubclass.txt | 104 ++++++++++++++++++ .../kotlin/ir/IrTextTestCaseGenerated.java | 6 + 3 files changed, 117 insertions(+) create mode 100644 compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt create mode 100644 compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.txt diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt new file mode 100644 index 00000000000..80701c9f1c4 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt @@ -0,0 +1,7 @@ +abstract class Base1 +class Derived1 : Base1() + +abstract class Base2 { + fun foo(x: T) {} +} +class Derived2 : Base2() diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.txt new file mode 100644 index 00000000000..7c503ac3379 --- /dev/null +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.txt @@ -0,0 +1,104 @@ +FILE fqName: fileName:/typeParameterBoundedBySubclass.kt + CLASS CLASS name:Base1 modality:ABSTRACT visibility:public flags: + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:Base1 flags: + superClasses: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + TYPE_PARAMETER name:T index:0 variance: upperBounds:[Derived1] + superClassifiers: + CLASS CLASS name:Derived1 modality:FINAL visibility:public flags: + CONSTRUCTOR visibility:public <> () returnType:Base1 flags: + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' + INSTANCE_INITIALIZER_CALL classDescriptor='Base1' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + CLASS CLASS name:Derived1 modality:FINAL visibility:public flags: + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:Derived1 flags: + superClasses: + CLASS CLASS name:Base1 modality:ABSTRACT visibility:public flags: + CONSTRUCTOR visibility:public <> () returnType:Derived1 flags: + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'constructor Base1()' + : Derived1 + INSTANCE_INITIALIZER_CALL classDescriptor='Derived1' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + overridden: + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + overridden: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + overridden: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + CLASS CLASS name:Base2 modality:ABSTRACT visibility:public flags: + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:Base2 flags: + superClasses: + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags: + CONSTRUCTOR visibility:public <> () returnType:Base2 flags: + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' + INSTANCE_INITIALIZER_CALL classDescriptor='Base2' + FUN name:foo visibility:public modality:FINAL ($this:Base2, x:T) returnType:Unit flags: + TYPE_PARAMETER name:T index:0 variance: upperBounds:[Derived2] + superClassifiers: + CLASS CLASS name:Derived2 modality:FINAL visibility:public flags: + $this: VALUE_PARAMETER name: type:Base2 flags: + VALUE_PARAMETER name:x index:0 type:T flags: + BLOCK_BODY + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + overridden: + FUN IR_EXTERNAL_DECLARATION_STUB name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + CLASS CLASS name:Derived2 modality:FINAL visibility:public flags: + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:Derived2 flags: + superClasses: + CLASS CLASS name:Base2 modality:ABSTRACT visibility:public flags: + CONSTRUCTOR visibility:public <> () returnType:Derived2 flags: + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'constructor Base2()' + INSTANCE_INITIALIZER_CALL classDescriptor='Derived2' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL ($this:Base2, x:T) returnType:Unit flags: + overridden: + FUN name:foo visibility:public modality:FINAL ($this:Base2, x:T) returnType:Unit flags: + TYPE_PARAMETER name:T index:0 variance: upperBounds:[Derived2] + superClassifiers: + CLASS CLASS name:Derived2 modality:FINAL visibility:public flags: + $this: VALUE_PARAMETER name: type:Base2 flags: + VALUE_PARAMETER name:x index:0 type:T flags: + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + overridden: + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:Boolean flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + VALUE_PARAMETER name:other index:0 type:kotlin.Any? flags: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + overridden: + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:Int flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + overridden: + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:String flags: + $this: VALUE_PARAMETER name: type:kotlin.Any flags: diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index 69001b0df9e..8d6f711020f 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -424,6 +424,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.kt"); doTest(fileName); } + + @TestMetadata("typeParameterBoundedBySubclass.kt") + public void testTypeParameterBoundedBySubclass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/parameters/typeParameterBoundedBySubclass.kt"); + doTest(fileName); + } } @TestMetadata("compiler/testData/ir/irText/declarations/provideDelegate")