psi2ir: inferred type for 'when' is Nothing only if it's exhaustive

TODO: fix inference bug
This commit is contained in:
Dmitry Petrov
2018-05-03 16:25:05 +03:00
parent 70622ff668
commit 21dfee4565
6 changed files with 117 additions and 10 deletions
@@ -76,7 +76,7 @@ FILE fqName:<root> fileName:/whenByFloatingPoint.kt
WHEN type=kotlin.Int origin=WHEN
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double
typeOperand: UNBOUND: class Double : kotlin.Number, kotlin.Comparable<kotlin.Double>, java.io.Serializable
typeOperand: CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:Double modality:FINAL visibility:public flags:
GET_VAR 'tmp0_subject: Any' type=kotlin.Any origin=null
then: CONST Int type=kotlin.Int value=-1
BRANCH
+1 -1
View File
@@ -40,7 +40,7 @@ FILE fqName:<root> fileName:/when.kt
then: CONST String type=kotlin.String value=A
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String
typeOperand: UNBOUND: class String : kotlin.Comparable<kotlin.String>, kotlin.CharSequence, java.io.Serializable
typeOperand: CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:String modality:FINAL visibility:public flags:
GET_VAR 'tmp0_subject: Any?' type=kotlin.Any? origin=null
then: CONST String type=kotlin.String value=String
BRANCH