[FE 1.0] Fix false positive INTEGER_OPERATOR_RESOLVE_WILL_CHANGE
^KT-47729 In progress
This commit is contained in:
committed by
TeamCityServer
parent
2fb5f776d8
commit
afb7625d0c
@@ -0,0 +1,22 @@
|
||||
// LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition
|
||||
// ISSUE: Kt-47447, KT-47729
|
||||
|
||||
fun takeLong(value : Long) {}
|
||||
fun takeInt(value : Int) {}
|
||||
fun takeAny(value : Any) {}
|
||||
fun takeLongX(value : Long?) {}
|
||||
fun takeIntX(value : Int?) {}
|
||||
fun takeAnyX(value : Any?) {}
|
||||
fun <A> takeGeneric(value : A) {}
|
||||
fun <A> takeGenericX(value : A?) {}
|
||||
|
||||
fun test_1() {
|
||||
takeLong(<!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>) // warning
|
||||
takeInt(1 + 1) // ok
|
||||
takeAny(1 + 1) // ok
|
||||
takeLongX(<!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>) // warning
|
||||
takeIntX(1 + 1) // ok
|
||||
takeAnyX(1 + 1) // ok
|
||||
takeGeneric(1 + 1) // ok
|
||||
takeGenericX(1 + 1) // ok
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition
|
||||
// ISSUE: Kt-47447, KT-47729
|
||||
|
||||
fun takeLong(value : Long) {}
|
||||
fun takeInt(value : Int) {}
|
||||
fun takeAny(value : Any) {}
|
||||
fun takeLongX(value : Long?) {}
|
||||
fun takeIntX(value : Int?) {}
|
||||
fun takeAnyX(value : Any?) {}
|
||||
fun <A> takeGeneric(value : A) {}
|
||||
fun <A> takeGenericX(value : A?) {}
|
||||
|
||||
fun test_1() {
|
||||
takeLong(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>) // warning
|
||||
takeInt(1 + 1) // ok
|
||||
takeAny(1 + 1) // ok
|
||||
takeLongX(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>) // warning
|
||||
takeIntX(1 + 1) // ok
|
||||
takeAnyX(1 + 1) // ok
|
||||
takeGeneric(1 + 1) // ok
|
||||
takeGenericX(1 + 1) // ok
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
public fun takeAny(/*0*/ value: kotlin.Any): kotlin.Unit
|
||||
public fun takeAnyX(/*0*/ value: kotlin.Any?): kotlin.Unit
|
||||
public fun </*0*/ A> takeGeneric(/*0*/ value: A): kotlin.Unit
|
||||
public fun </*0*/ A> takeGenericX(/*0*/ value: A?): kotlin.Unit
|
||||
public fun takeInt(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||
public fun takeIntX(/*0*/ value: kotlin.Int?): kotlin.Unit
|
||||
public fun takeLong(/*0*/ value: kotlin.Long): kotlin.Unit
|
||||
public fun takeLongX(/*0*/ value: kotlin.Long?): kotlin.Unit
|
||||
public fun test_1(): kotlin.Unit
|
||||
Reference in New Issue
Block a user