psi2ir: Update testData for intersection type tests

Actually, IrType-based InsertImplicitCasts provides proper casts here.
This commit is contained in:
Dmitry Petrov
2019-04-15 16:11:59 +03:00
parent 3fa671943c
commit 38ad56fb78
3 changed files with 85 additions and 71 deletions
+4 -2
View File
@@ -37,8 +37,10 @@ FILE fqName:<root> fileName:/intersectionType1.kt
$receiver: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=<root>.In<kotlin.Any?> origin=GET_ARRAY_ELEMENT $receiver: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=<root>.In<kotlin.Any?> origin=GET_ARRAY_ELEMENT
$this: CALL 'public final fun select <S> (x: S of <root>.select, y: S of <root>.select): S of <root>.select declared in <root>' type=kotlin.Array<out <root>.In<kotlin.Any?>> origin=null $this: CALL 'public final fun select <S> (x: S of <root>.select, y: S of <root>.select): S of <root>.select declared in <root>' type=kotlin.Array<out <root>.In<kotlin.Any?>> origin=null
<S>: kotlin.Array<out <root>.In<kotlin.Any?>> <S>: kotlin.Array<out <root>.In<kotlin.Any?>>
x: GET_VAR 'a: kotlin.Array<<root>.In<T of <root>.foo>> declared in <root>.foo' type=kotlin.Array<<root>.In<T of <root>.foo>> origin=null x: TYPE_OP type=kotlin.Array<out <root>.In<kotlin.Any?>> origin=IMPLICIT_CAST typeOperand=kotlin.Array<out <root>.In<kotlin.Any?>>
y: GET_VAR 'b: kotlin.Array<<root>.In<kotlin.String>> declared in <root>.foo' type=kotlin.Array<<root>.In<kotlin.String>> origin=null GET_VAR 'a: kotlin.Array<<root>.In<T of <root>.foo>> declared in <root>.foo' type=kotlin.Array<<root>.In<T of <root>.foo>> origin=null
y: TYPE_OP type=kotlin.Array<out <root>.In<kotlin.Any?>> origin=IMPLICIT_CAST typeOperand=kotlin.Array<out <root>.In<kotlin.Any?>>
GET_VAR 'b: kotlin.Array<<root>.In<kotlin.String>> declared in <root>.foo' type=kotlin.Array<<root>.In<kotlin.String>> origin=null
index: CONST Int type=kotlin.Int value=0 index: CONST Int type=kotlin.Int value=0
y: CONST Boolean type=kotlin.Boolean value=true y: CONST Boolean type=kotlin.Boolean value=true
FUN name:ofType visibility:public modality:FINAL <K> ($receiver:<root>.In<K of <root>.ofType>, y:kotlin.Any?) returnType:kotlin.Boolean [inline] FUN name:ofType visibility:public modality:FINAL <K> ($receiver:<root>.In<K of <root>.ofType>, y:kotlin.Any?) returnType:kotlin.Boolean [inline]
+24 -12
View File
@@ -141,8 +141,10 @@ FILE fqName:<root> fileName:/intersectionType3.kt
<T>: kotlin.Any <T>: kotlin.Any
$receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<kotlin.Any> origin=null $receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<kotlin.Any> origin=null
<S>: <root>.In<kotlin.Any> <S>: <root>.In<kotlin.Any>
x: GET_VAR 'x: <root>.In<<root>.A> declared in <root>.testInIs1' type=<root>.In<<root>.A> origin=null x: TYPE_OP type=<root>.In<kotlin.Any> origin=IMPLICIT_CAST typeOperand=<root>.In<kotlin.Any>
y: GET_VAR 'y: <root>.In<<root>.B> declared in <root>.testInIs1' type=<root>.In<<root>.B> origin=null GET_VAR 'x: <root>.In<<root>.A> declared in <root>.testInIs1' type=<root>.In<<root>.A> origin=null
y: TYPE_OP type=<root>.In<kotlin.Any> origin=IMPLICIT_CAST typeOperand=<root>.In<kotlin.Any>
GET_VAR 'y: <root>.In<<root>.B> declared in <root>.testInIs1' type=<root>.In<<root>.B> origin=null
FUN name:testInIs2 visibility:public modality:FINAL <> (x:<root>.In<<root>.Z1>, y:<root>.In<<root>.Z2>) returnType:kotlin.Boolean FUN name:testInIs2 visibility:public modality:FINAL <> (x:<root>.In<<root>.Z1>, y:<root>.In<<root>.Z2>) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.Z1> VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.Z1>
VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.Z2> VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.Z2>
@@ -152,8 +154,10 @@ FILE fqName:<root> fileName:/intersectionType3.kt
<T>: kotlin.Any <T>: kotlin.Any
$receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<kotlin.Any> origin=null $receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<kotlin.Any> origin=null
<S>: <root>.In<kotlin.Any> <S>: <root>.In<kotlin.Any>
x: GET_VAR 'x: <root>.In<<root>.Z1> declared in <root>.testInIs2' type=<root>.In<<root>.Z1> origin=null x: TYPE_OP type=<root>.In<kotlin.Any> origin=IMPLICIT_CAST typeOperand=<root>.In<kotlin.Any>
y: GET_VAR 'y: <root>.In<<root>.Z2> declared in <root>.testInIs2' type=<root>.In<<root>.Z2> origin=null GET_VAR 'x: <root>.In<<root>.Z1> declared in <root>.testInIs2' type=<root>.In<<root>.Z1> origin=null
y: TYPE_OP type=<root>.In<kotlin.Any> origin=IMPLICIT_CAST typeOperand=<root>.In<kotlin.Any>
GET_VAR 'y: <root>.In<<root>.Z2> declared in <root>.testInIs2' type=<root>.In<<root>.Z2> origin=null
FUN name:testInIs3 visibility:public modality:FINAL <> (x:<root>.In<<root>.A1>, y:<root>.In<<root>.A2>) returnType:kotlin.Boolean FUN name:testInIs3 visibility:public modality:FINAL <> (x:<root>.In<<root>.A1>, y:<root>.In<<root>.A2>) returnType:kotlin.Boolean
VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.A1> VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.A1>
VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.A2> VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.A2>
@@ -163,8 +167,10 @@ FILE fqName:<root> fileName:/intersectionType3.kt
<T>: <root>.A <T>: <root>.A
$receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<<root>.A> origin=null $receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<<root>.A> origin=null
<S>: <root>.In<<root>.A> <S>: <root>.In<<root>.A>
x: GET_VAR 'x: <root>.In<<root>.A1> declared in <root>.testInIs3' type=<root>.In<<root>.A1> origin=null x: TYPE_OP type=<root>.In<<root>.A> origin=IMPLICIT_CAST typeOperand=<root>.In<<root>.A>
y: GET_VAR 'y: <root>.In<<root>.A2> declared in <root>.testInIs3' type=<root>.In<<root>.A2> origin=null GET_VAR 'x: <root>.In<<root>.A1> declared in <root>.testInIs3' type=<root>.In<<root>.A1> origin=null
y: TYPE_OP type=<root>.In<<root>.A> origin=IMPLICIT_CAST typeOperand=<root>.In<<root>.A>
GET_VAR 'y: <root>.In<<root>.A2> declared in <root>.testInIs3' type=<root>.In<<root>.A2> origin=null
FUN name:testInAs1 visibility:public modality:FINAL <> (x:<root>.In<<root>.A>, y:<root>.In<<root>.B>) returnType:kotlin.Unit FUN name:testInAs1 visibility:public modality:FINAL <> (x:<root>.In<<root>.A>, y:<root>.In<<root>.B>) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.A> VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.A>
VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.B> VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.B>
@@ -174,8 +180,10 @@ FILE fqName:<root> fileName:/intersectionType3.kt
<T>: kotlin.Any <T>: kotlin.Any
$receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<kotlin.Any> origin=null $receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<kotlin.Any> origin=null
<S>: <root>.In<kotlin.Any> <S>: <root>.In<kotlin.Any>
x: GET_VAR 'x: <root>.In<<root>.A> declared in <root>.testInAs1' type=<root>.In<<root>.A> origin=null x: TYPE_OP type=<root>.In<kotlin.Any> origin=IMPLICIT_CAST typeOperand=<root>.In<kotlin.Any>
y: GET_VAR 'y: <root>.In<<root>.B> declared in <root>.testInAs1' type=<root>.In<<root>.B> origin=null GET_VAR 'x: <root>.In<<root>.A> declared in <root>.testInAs1' type=<root>.In<<root>.A> origin=null
y: TYPE_OP type=<root>.In<kotlin.Any> origin=IMPLICIT_CAST typeOperand=<root>.In<kotlin.Any>
GET_VAR 'y: <root>.In<<root>.B> declared in <root>.testInAs1' type=<root>.In<<root>.B> origin=null
FUN name:testInAs2 visibility:public modality:FINAL <> (x:<root>.In<<root>.Z1>, y:<root>.In<<root>.Z2>) returnType:kotlin.Unit FUN name:testInAs2 visibility:public modality:FINAL <> (x:<root>.In<<root>.Z1>, y:<root>.In<<root>.Z2>) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.Z1> VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.Z1>
VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.Z2> VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.Z2>
@@ -185,8 +193,10 @@ FILE fqName:<root> fileName:/intersectionType3.kt
<T>: kotlin.Any <T>: kotlin.Any
$receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<kotlin.Any> origin=null $receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<kotlin.Any> origin=null
<S>: <root>.In<kotlin.Any> <S>: <root>.In<kotlin.Any>
x: GET_VAR 'x: <root>.In<<root>.Z1> declared in <root>.testInAs2' type=<root>.In<<root>.Z1> origin=null x: TYPE_OP type=<root>.In<kotlin.Any> origin=IMPLICIT_CAST typeOperand=<root>.In<kotlin.Any>
y: GET_VAR 'y: <root>.In<<root>.Z2> declared in <root>.testInAs2' type=<root>.In<<root>.Z2> origin=null GET_VAR 'x: <root>.In<<root>.Z1> declared in <root>.testInAs2' type=<root>.In<<root>.Z1> origin=null
y: TYPE_OP type=<root>.In<kotlin.Any> origin=IMPLICIT_CAST typeOperand=<root>.In<kotlin.Any>
GET_VAR 'y: <root>.In<<root>.Z2> declared in <root>.testInAs2' type=<root>.In<<root>.Z2> origin=null
FUN name:testInAs3 visibility:public modality:FINAL <> (x:<root>.In<<root>.A1>, y:<root>.In<<root>.A2>) returnType:kotlin.Unit FUN name:testInAs3 visibility:public modality:FINAL <> (x:<root>.In<<root>.A1>, y:<root>.In<<root>.A2>) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.A1> VALUE_PARAMETER name:x index:0 type:<root>.In<<root>.A1>
VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.A2> VALUE_PARAMETER name:y index:1 type:<root>.In<<root>.A2>
@@ -196,5 +206,7 @@ FILE fqName:<root> fileName:/intersectionType3.kt
<T>: <root>.A <T>: <root>.A
$receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<<root>.A> origin=null $receiver: CALL 'public final fun sel <S> (x: S of <root>.sel, y: S of <root>.sel): S of <root>.sel declared in <root>' type=<root>.In<<root>.A> origin=null
<S>: <root>.In<<root>.A> <S>: <root>.In<<root>.A>
x: GET_VAR 'x: <root>.In<<root>.A1> declared in <root>.testInAs3' type=<root>.In<<root>.A1> origin=null x: TYPE_OP type=<root>.In<<root>.A> origin=IMPLICIT_CAST typeOperand=<root>.In<<root>.A>
y: GET_VAR 'y: <root>.In<<root>.A2> declared in <root>.testInAs3' type=<root>.In<<root>.A2> origin=null GET_VAR 'x: <root>.In<<root>.A1> declared in <root>.testInAs3' type=<root>.In<<root>.A1> origin=null
y: TYPE_OP type=<root>.In<<root>.A> origin=IMPLICIT_CAST typeOperand=<root>.In<<root>.A>
GET_VAR 'y: <root>.In<<root>.A2> declared in <root>.testInAs3' type=<root>.In<<root>.A2> origin=null