[FE 1.0] Report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE on calls in parenthesis
^KT-47729 In progress
This commit is contained in:
committed by
TeamCityServer
parent
ea4ab46765
commit
2fb5f776d8
@@ -0,0 +1,20 @@
|
||||
// LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition
|
||||
// ISSUE: Kt-47447, KT-47729
|
||||
|
||||
fun takeLong(x: Long) {}
|
||||
|
||||
object Foo {
|
||||
var longProperty: Long = 0
|
||||
|
||||
infix fun infixOperator(x: Long) {}
|
||||
}
|
||||
|
||||
// Should be warning in all places
|
||||
fun test() {
|
||||
takeLong(<!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>)
|
||||
takeLong((<!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>))
|
||||
Foo.longProperty = 1 + 1
|
||||
Foo.longProperty = (1 + 1)
|
||||
Foo infixOperator <!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>
|
||||
Foo infixOperator (<!ARGUMENT_TYPE_MISMATCH!>1 + 1<!>)
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition
|
||||
// ISSUE: Kt-47447, KT-47729
|
||||
|
||||
fun takeLong(x: Long) {}
|
||||
|
||||
object Foo {
|
||||
var longProperty: Long = 0
|
||||
|
||||
infix fun infixOperator(x: Long) {}
|
||||
}
|
||||
|
||||
// Should be warning in all places
|
||||
fun test() {
|
||||
takeLong(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>)
|
||||
takeLong((<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>))
|
||||
Foo.longProperty = 1 + 1
|
||||
Foo.longProperty = (1 + 1)
|
||||
Foo infixOperator <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>
|
||||
Foo infixOperator (<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package
|
||||
|
||||
public fun takeLong(/*0*/ x: kotlin.Long): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public object Foo {
|
||||
private constructor Foo()
|
||||
public final var longProperty: kotlin.Long
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final infix fun infixOperator(/*0*/ x: kotlin.Long): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user