Files
kotlin-fork/compiler/testData/diagnostics/tests/numbers/kt47729_parenthesis.kt
T
Dmitriy Novozhilov 7917e511ed [FE 1.0] Disable INTEGER_OPERATOR_RESOLVE_WILL_CHANGE warning by default
Also remove sinceVersion parameter from
  ApproximateIntegerLiteralTypesInReceiverPosition language feature

^KT-48992 Fixed
2021-09-29 21:23:22 +03:00

21 lines
713 B
Kotlin
Vendored

// LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition +ReportChangingIntegerOperatorResolve
// 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 = <!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<!>)
}