[FE 1.0] Properly report INTEGER_OPERATOR_RESOLVE_WILL_CHANGE

^KT-38895
This commit is contained in:
Dmitriy Novozhilov
2021-11-10 16:09:58 +03:00
committed by teamcity
parent 21444d6be8
commit 62b774b2e3
26 changed files with 126 additions and 131 deletions
@@ -1,4 +1,4 @@
// LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition +ReportChangingIntegerOperatorResolve
// LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition
// ISSUE: Kt-47447, KT-47729
fun takeLong(x: Long) {}
@@ -9,12 +9,12 @@ object Foo {
infix fun infixOperator(x: Long) {}
}
// Should be warning in all places
// Should be ok in all places
fun test() {
takeLong(<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>)
takeLong((<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>))
Foo.longProperty = <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>
Foo.longProperty = (<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>)
Foo infixOperator <!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>
Foo infixOperator (<!INTEGER_OPERATOR_RESOLVE_WILL_CHANGE!>1 + 1<!>)
takeLong(1 + 1)
takeLong((1 + 1))
Foo.longProperty = 1 + 1
Foo.longProperty = (1 + 1)
Foo infixOperator 1 + 1
Foo infixOperator (1 + 1)
}