[FE 1.0] Report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE on calls in parenthesis

^KT-47729 In progress
This commit is contained in:
Dmitriy Novozhilov
2021-07-15 13:00:42 +03:00
committed by TeamCityServer
parent ea4ab46765
commit 2fb5f776d8
8 changed files with 85 additions and 5 deletions
@@ -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
}