FIR2IR: Do not add implicit casts for types with different nullability

For smart casts, elvises, etc., there are no implicit casts in psi2fir
in changed test data
This commit is contained in:
Denis.Zharkov
2021-01-28 16:38:41 +03:00
parent 5c62ee4ba8
commit 1e0d9f4075
46 changed files with 106 additions and 264 deletions
@@ -17,8 +17,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
then: BREAK label=L loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in <root>.test1' type=kotlin.Boolean? origin=null
then: GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in <root>.test1' type=kotlin.Boolean? origin=null
body: BLOCK type=kotlin.Unit origin=null
FUN name:test2 visibility:public modality:FINAL <> (c:kotlin.Boolean?) returnType:kotlin.Unit
VALUE_PARAMETER name:c index:0 type:kotlin.Boolean?
@@ -38,8 +37,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
then: CONTINUE label=L loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in <root>.test2' type=kotlin.Boolean? origin=null
then: GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in <root>.test2' type=kotlin.Boolean? origin=null
body: BLOCK type=kotlin.Unit origin=null
FUN name:test3 visibility:public modality:FINAL <> (ss:kotlin.collections.List<kotlin.String>?) returnType:kotlin.Unit
VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List<kotlin.String>?
@@ -61,8 +59,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
then: CONTINUE label=L loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.collections.List<kotlin.String> origin=IMPLICIT_CAST typeOperand=kotlin.collections.List<kotlin.String>
GET_VAR 'val tmp_3: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test3' type=kotlin.collections.List<kotlin.String>? origin=null
then: GET_VAR 'val tmp_3: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test3' type=kotlin.collections.List<kotlin.String>? origin=null
WHILE label=L2 origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_2: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.test3' type=kotlin.collections.Iterator<kotlin.String> origin=null
@@ -90,8 +87,7 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
then: BREAK label=L loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.collections.List<kotlin.String> origin=IMPLICIT_CAST typeOperand=kotlin.collections.List<kotlin.String>
GET_VAR 'val tmp_5: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test4' type=kotlin.collections.List<kotlin.String>? origin=null
then: GET_VAR 'val tmp_5: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test4' type=kotlin.collections.List<kotlin.String>? origin=null
WHILE label=L2 origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.test4' type=kotlin.collections.Iterator<kotlin.String> origin=null