[FIR] FIR2IR: Populate calls with type arguments and function type

parameters with bounds/supertypes.
This commit is contained in:
Mark Punzalan
2019-11-23 23:37:35 -08:00
committed by Mikhail Glukhikh
parent 58dd9a6004
commit 5afab1ac2b
125 changed files with 379 additions and 341 deletions
+9 -6
View File
@@ -1,7 +1,7 @@
FILE fqName:<root> fileName:/builtinMap.kt
FUN name:plus visibility:public modality:FINAL <K1, V1> ($receiver:kotlin.collections.Map<out K1 of <root>.plus, V1 of <root>.plus>, pair:kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus>) returnType:kotlin.collections.Map<K1 of <root>.plus, V1 of <root>.plus>
TYPE_PARAMETER name:K1 index:0 variance: superTypes:[]
TYPE_PARAMETER name:V1 index:0 variance: superTypes:[]
TYPE_PARAMETER name:K1 index:0 variance: superTypes:[kotlin.Any?]
TYPE_PARAMETER name:V1 index:0 variance: superTypes:[kotlin.Any?]
$receiver: VALUE_PARAMETER name:<this> type:kotlin.collections.Map<out K1 of <root>.plus, V1 of <root>.plus>
VALUE_PARAMETER name:pair index:0 type:kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus>
BLOCK_BODY
@@ -10,14 +10,17 @@ FILE fqName:<root> fileName:/builtinMap.kt
BRANCH
if: CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null
$this: GET_VAR '<this>: kotlin.collections.Map<out K1 of <root>.plus, V1 of <root>.plus> declared in <root>.plus' type=kotlin.collections.Map<out K1 of <root>.plus, V1 of <root>.plus> origin=null
then: CALL 'public final fun mapOf (pair: kotlin.Pair<K of <uninitialized parent>, V of <uninitialized parent>>): kotlin.collections.Map<K of <uninitialized parent>, V of <uninitialized parent>> declared in kotlin.collections' type=kotlin.collections.Map<K1 of <root>.plus, V1 of <root>.plus> origin=null
then: CALL 'public final fun mapOf <K, V> (pair: kotlin.Pair<K of kotlin.collections.mapOf, V of kotlin.collections.mapOf>): kotlin.collections.Map<K of kotlin.collections.mapOf, V of kotlin.collections.mapOf> declared in kotlin.collections' type=kotlin.collections.Map<K1 of <root>.plus, V1 of <root>.plus> origin=null
<K>: K1 of <root>.plus
<V>: V1 of <root>.plus
pair: GET_VAR 'pair: kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> declared in <root>.plus' type=kotlin.Pair<K1 of <root>.plus, V1 of <root>.plus> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun apply (block: kotlin.Function1<T of <uninitialized parent>, kotlin.Unit>): T of <uninitialized parent> [inline] declared in kotlin' type=java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> origin=null
then: CALL 'public final fun apply <T> (block: kotlin.Function1<T of kotlin.apply, kotlin.Unit>): T of kotlin.apply [inline] declared in kotlin' type=java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> origin=null
<T>: java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus>
$receiver: CONSTRUCTOR_CALL 'public constructor <init> (p0: kotlin.collections.Map<out K of java.util.LinkedHashMap, out V of java.util.LinkedHashMap>?) declared in java.util.LinkedHashMap' type=java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus> origin=null
<class: K>: <none>
<class: V>: <none>
<class: K>: K1 of <root>.plus
<class: V>: V1 of <root>.plus
p0: GET_VAR '<this>: kotlin.collections.Map<out K1 of <root>.plus, V1 of <root>.plus> declared in <root>.plus' type=kotlin.collections.Map<out K1 of <root>.plus, V1 of <root>.plus> origin=null
block: FUN_EXPR type=kotlin.Function1<java.util.LinkedHashMap<K1 of <root>.plus, V1 of <root>.plus>, kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Unit
@@ -1,7 +1,7 @@
FILE fqName:<root> fileName:/genericClassInDifferentModule_m1.kt
CLASS CLASS name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Base
TYPE_PARAMETER name:T index:0 variance: superTypes:[]
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> (x:T of <uninitialized parent>) returnType:<root>.Base<T of <uninitialized parent>> [primary]
VALUE_PARAMETER name:x index:0 type:T of <uninitialized parent>
BLOCK_BODY
@@ -19,7 +19,7 @@ FILE fqName:<root> fileName:/genericClassInDifferentModule_m1.kt
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of <root>.Base visibility:private [final]' type=T of <root>.Base origin=null
receiver: GET_VAR '<this>: <root>.Base declared in <root>.Base.<get-x>' type=<root>.Base origin=null
FUN name:foo visibility:public modality:ABSTRACT <Y> ($this:<root>.Base, y:Y of <root>.Base.foo) returnType:T of <root>.Base
TYPE_PARAMETER name:Y index:0 variance: superTypes:[]
TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.Base
VALUE_PARAMETER name:y index:0 type:Y of <root>.Base.foo
PROPERTY name:bar visibility:public modality:ABSTRACT [var]
@@ -1,7 +1,7 @@
FILE fqName:<root> fileName:/genericClassInDifferentModule_m2.kt
CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[<root>.Base<T of <root>.Derived1>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Derived1
TYPE_PARAMETER name:T index:0 variance: superTypes:[]
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> (x:T of <uninitialized parent>) returnType:<root>.Derived1<T of <uninitialized parent>> [primary]
VALUE_PARAMETER name:x index:0 type:T of <uninitialized parent>
BLOCK_BODY
@@ -10,7 +10,7 @@ FILE fqName:<root> fileName:/genericClassInDifferentModule_m2.kt
x: GET_VAR 'x: T of <uninitialized parent> declared in <root>.Derived1.<init>' type=T of <uninitialized parent> origin=null
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[<root>.Base<T of <root>.Derived1>]'
FUN name:foo visibility:public modality:FINAL <Y> ($this:<root>.Derived1, y:Y of <root>.Derived1.foo) returnType:T of <root>.Derived1
TYPE_PARAMETER name:Y index:0 variance: superTypes:[]
TYPE_PARAMETER name:Y index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.Derived1
VALUE_PARAMETER name:y index:0 type:Y of <root>.Derived1.foo
BLOCK_BODY
@@ -3,23 +3,19 @@ FILE fqName:<root> fileName:/javaConstructorWithTypeParameters.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 (): <root>.J1<kotlin.Int> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.J1' type=<root>.J1<kotlin.Int> origin=null
<class: T1>: <none>
<class: T1>: kotlin.Int
FUN name:test2 visibility:public modality:FINAL <> () returnType:<root>.J1<kotlin.Int>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 (): <root>.J1<kotlin.Int> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> (x1: X1 of <uninitialized parent>?) declared in <root>.J1' type=<root>.J1<kotlin.Int> origin=null
<class: T1>: <none>
x1: CONST Int type=kotlin.Int value=1
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.J1<kotlin.Int>
FUN name:test3 visibility:public modality:FINAL <> (j1:<root>.J1<kotlin.Any>) returnType:<root>.J1.J2<kotlin.Int>
VALUE_PARAMETER name:j1 index:0 type:<root>.J1<kotlin.Any>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3 (j1: <root>.J1<kotlin.Any>): <root>.J1.J2<kotlin.Int> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.J1.J2' type=<root>.J1.J2<kotlin.Int> origin=null
<class: T2>: <none>
<class: T2>: kotlin.Int
FUN name:test4 visibility:public modality:FINAL <> (j1:<root>.J1<kotlin.Any>) returnType:<root>.J1.J2<kotlin.Int>
VALUE_PARAMETER name:j1 index:0 type:<root>.J1<kotlin.Any>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test4 (j1: <root>.J1<kotlin.Any>): <root>.J1.J2<kotlin.Int> declared in <root>'
CONSTRUCTOR_CALL 'public constructor <init> (x2: X2 of <uninitialized parent>?) declared in <root>.J1.J2' type=<root>.J1.J2<kotlin.Int> origin=null
<class: T2>: <none>
x2: CONST Int type=kotlin.Int value=1
ERROR_EXPR 'Cannot bind 2 type arguments to ??? call with 1 type parameters' type=<root>.J1.J2<kotlin.Int>