KT-16666 IMPLICIT_INTEGER_COERCION expression should have non-nullable type
This commit is contained in:
+1
-1
@@ -184,7 +184,7 @@ class InsertImplicitCasts(val builtIns: KotlinBuiltIns): IrElementTransformerVoi
|
|||||||
KotlinTypeChecker.DEFAULT.isSubtypeOf(valueType.makeNotNullable(), expectedType) ->
|
KotlinTypeChecker.DEFAULT.isSubtypeOf(valueType.makeNotNullable(), expectedType) ->
|
||||||
this
|
this
|
||||||
KotlinBuiltIns.isInt(valueType) && notNullableExpectedType.isBuiltInIntegerType() ->
|
KotlinBuiltIns.isInt(valueType) && notNullableExpectedType.isBuiltInIntegerType() ->
|
||||||
IrTypeOperatorCallImpl(startOffset, endOffset, expectedType,
|
IrTypeOperatorCallImpl(startOffset, endOffset, notNullableExpectedType,
|
||||||
IrTypeOperator.IMPLICIT_INTEGER_COERCION, notNullableExpectedType, this)
|
IrTypeOperator.IMPLICIT_INTEGER_COERCION, notNullableExpectedType, this)
|
||||||
else ->
|
else ->
|
||||||
IrTypeOperatorCallImpl(startOffset, endOffset, expectedType,
|
IrTypeOperatorCallImpl(startOffset, endOffset, expectedType,
|
||||||
|
|||||||
@@ -64,15 +64,15 @@ FILE /primitivesImplicitConversions.kt
|
|||||||
VAR val test4: kotlin.Long? = -1.toLong()
|
VAR val test4: kotlin.Long? = -1.toLong()
|
||||||
CONST Long type=kotlin.Long value='-1'
|
CONST Long type=kotlin.Long value='-1'
|
||||||
VAR val test5: kotlin.Long? = -1.toLong()
|
VAR val test5: kotlin.Long? = -1.toLong()
|
||||||
TYPE_OP type=kotlin.Long? origin=IMPLICIT_INTEGER_COERCION typeOperand=kotlin.Long
|
TYPE_OP type=kotlin.Long origin=IMPLICIT_INTEGER_COERCION typeOperand=kotlin.Long
|
||||||
CALL 'unaryMinus(): Int' type=kotlin.Int origin=null
|
CALL 'unaryMinus(): Int' type=kotlin.Int origin=null
|
||||||
$this: CONST Int type=kotlin.Int value='1'
|
$this: CONST Int type=kotlin.Int value='1'
|
||||||
VAR val test6: kotlin.Short? = -1.toShort()
|
VAR val test6: kotlin.Short? = -1.toShort()
|
||||||
TYPE_OP type=kotlin.Short? origin=IMPLICIT_INTEGER_COERCION typeOperand=kotlin.Short
|
TYPE_OP type=kotlin.Short origin=IMPLICIT_INTEGER_COERCION typeOperand=kotlin.Short
|
||||||
CALL 'unaryMinus(): Int' type=kotlin.Int origin=null
|
CALL 'unaryMinus(): Int' type=kotlin.Int origin=null
|
||||||
$this: CONST Int type=kotlin.Int value='1'
|
$this: CONST Int type=kotlin.Int value='1'
|
||||||
VAR val test7: kotlin.Byte? = -1.toByte()
|
VAR val test7: kotlin.Byte? = -1.toByte()
|
||||||
TYPE_OP type=kotlin.Byte? origin=IMPLICIT_INTEGER_COERCION typeOperand=kotlin.Byte
|
TYPE_OP type=kotlin.Byte origin=IMPLICIT_INTEGER_COERCION typeOperand=kotlin.Byte
|
||||||
CALL 'unaryMinus(): Int' type=kotlin.Int origin=null
|
CALL 'unaryMinus(): Int' type=kotlin.Int origin=null
|
||||||
$this: CONST Int type=kotlin.Int value='1'
|
$this: CONST Int type=kotlin.Int value='1'
|
||||||
FUN public fun testImplicitArguments(x: kotlin.Long = ...): kotlin.Unit
|
FUN public fun testImplicitArguments(x: kotlin.Long = ...): kotlin.Unit
|
||||||
|
|||||||
Reference in New Issue
Block a user