Add one more IR text test case

This commit is contained in:
Svyatoslav Scherbina
2018-03-16 12:52:05 +03:00
parent aac940415f
commit f3bc8d179c
3 changed files with 117 additions and 0 deletions
@@ -0,0 +1,7 @@
abstract class Base1<T : Derived1>
class Derived1 : Base1<Derived1>()
abstract class Base2 {
fun <T : Derived2> foo(x: T) {}
}
class Derived2 : Base2()
@@ -0,0 +1,104 @@
FILE fqName:<root> fileName:/typeParameterBoundedBySubclass.kt
CLASS CLASS name:Base1 modality:ABSTRACT visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:Base1<T> 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<T> 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:<this> 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:<this> 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:<this> type:kotlin.Any flags:
CLASS CLASS name:Derived1 modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> 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()'
<T : Derived1>: 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:<this> 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:<this> 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:<this> type:kotlin.Any flags:
CLASS CLASS name:Base2 modality:ABSTRACT visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> 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 <T> ($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:<this> 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:<this> 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:<this> 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:<this> type:kotlin.Any flags:
CLASS CLASS name:Derived2 modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> 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 <T> ($this:Base2, x:T) returnType:Unit flags:
overridden:
FUN name:foo visibility:public modality:FINAL <T> ($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:<this> 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:<this> 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:<this> 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:<this> type:kotlin.Any flags:
@@ -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")