Fix type arguments mapping

This commit is contained in:
Dmitry Petrov
2018-03-19 14:08:04 +03:00
parent eb5904ea8e
commit 135d3ab57a
33 changed files with 365 additions and 165 deletions
@@ -6,7 +6,7 @@ FILE fqName:<root> fileName:/enumEntryAsReceiver.kt
CONSTRUCTOR visibility:private <> () returnType:X flags:
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'constructor Enum(String, Int)'
<E : Enum<E>>: null
<E : Enum<E>>: X
INSTANCE_INITIALIZER_CALL classDescriptor='X'
ENUM_ENTRY name:B
init: ENUM_CONSTRUCTOR_CALL 'constructor B()'
@@ -0,0 +1,3 @@
class GenericClass<T>(val value: T) {
fun withNewValue(newValue: T) = GenericClass(newValue)
}
@@ -0,0 +1,44 @@
FILE fqName:<root> fileName:/memberTypeArguments.kt
CLASS CLASS name:GenericClass modality:FINAL visibility:public flags:
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:GenericClass<T> flags:
superClasses:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
TYPE_PARAMETER name:T index:0 variance: upperBounds:[kotlin.Any?]
superClassifiers:
CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Any modality:OPEN visibility:public flags:
CONSTRUCTOR visibility:public <> (value:T) returnType:GenericClass<T> flags:
VALUE_PARAMETER name:value index:0 type:T flags:
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='GenericClass'
PROPERTY name:value type:T visibility:public modality:FINAL flags:val
FIELD PROPERTY_BACKING_FIELD name:value type:T visibility:public
EXPRESSION_BODY
GET_VAR 'value-parameter value: T' type=T origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-value> visibility:public modality:FINAL <> ($this:GenericClass<T>) returnType:T flags:
$this: VALUE_PARAMETER name:<this> type:GenericClass<T> flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-value>(): T'
GET_FIELD 'value: T' type=T origin=null
receiver: GET_VAR 'this@GenericClass: GenericClass<T>' type=GenericClass<T> origin=null
FUN name:withNewValue visibility:public modality:FINAL <> ($this:GenericClass<T>, newValue:T) returnType:GenericClass<T> flags:
$this: VALUE_PARAMETER name:<this> type:GenericClass<T> flags:
VALUE_PARAMETER name:newValue index:0 type:T flags:
BLOCK_BODY
RETURN type=kotlin.Nothing from='withNewValue(T): GenericClass<T>'
CALL 'constructor GenericClass(T)' type=GenericClass<T> origin=null
<T>: T
value: GET_VAR 'value-parameter newValue: T' type=T origin=null
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:
@@ -27,7 +27,7 @@ FILE fqName:<root> fileName:/objectAsCallable.kt
CONSTRUCTOR visibility:private <> () returnType:En flags:
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'constructor Enum(String, Int)'
<E : Enum<E>>: null
<E : Enum<E>>: En
INSTANCE_INITIALIZER_CALL classDescriptor='En'
ENUM_ENTRY name:X
init: ENUM_CONSTRUCTOR_CALL 'constructor En()'
@@ -39,5 +39,5 @@ FILE fqName:<root> fileName:/specializedTypeAliasConstructorCall.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='test(): IntAlias /* = Cell<Int> */'
CALL 'constructor Cell(Int)' type=Cell<kotlin.Int> origin=null
<T>: null
<T>: Int
value: CONST Int type=kotlin.Int value=42
+1 -1
View File
@@ -6,7 +6,7 @@ FILE fqName:<root> fileName:/values.kt
CONSTRUCTOR visibility:private <> () returnType:Enum flags:
BLOCK_BODY
ENUM_CONSTRUCTOR_CALL 'constructor Enum(String, Int)'
<E : Enum<E>>: null
<E : Enum<E>>: Enum
INSTANCE_INITIALIZER_CALL classDescriptor='Enum'
ENUM_ENTRY name:A
init: ENUM_CONSTRUCTOR_CALL 'constructor Enum()'