f38c0cf348
Similarly to FIR diagnostic tests. This commit enable all available test data and check the reported error messages by FIR. This helps identify some issues in formatting of FIR diagnostics. The changes on the test file are mechanically generated. Failed tests are disabled with `// IGNORE_FIR` and are re-enabled in the second commit.
47 lines
559 B
Kotlin
Vendored
47 lines
559 B
Kotlin
Vendored
class IncDec() {
|
|
operator fun inc() : IncDec = this
|
|
operator fun dec() : IncDec = this
|
|
}
|
|
|
|
fun testIncDec() {
|
|
var x = IncDec()
|
|
x++
|
|
++x
|
|
x--
|
|
--x
|
|
x = x++
|
|
x = x--
|
|
x = ++x
|
|
x = --x
|
|
}
|
|
|
|
class WrongIncDec() {
|
|
operator fun inc() : Int = 1
|
|
operator fun dec() : Int = 1
|
|
}
|
|
|
|
fun testWrongIncDec() {
|
|
var x = WrongIncDec()
|
|
x++
|
|
++x
|
|
x--
|
|
--x
|
|
}
|
|
|
|
class UnitIncDec() {
|
|
operator fun inc() : Unit {}
|
|
operator fun dec() : Unit {}
|
|
}
|
|
|
|
fun testUnitIncDec() {
|
|
var x = UnitIncDec()
|
|
x++
|
|
++x
|
|
x--
|
|
--x
|
|
x = x++
|
|
x = x--
|
|
x = ++x
|
|
x = --x
|
|
}
|