Files
kotlin-fork/compiler/testData/codegen/box/operatorConventions/kt4987.kt
T
Michael Bogdanov 15043b3c6d Fixes for KT-4991: Prefix/postfix expressions resolved to local extensions are not supported in codegen;
KT-4989: Verify error on local functions and extensions;
KT-4987: NegativeArraySizeException on local extension convention function on nullable Int

  #KT-4991 Fixed
  #KT-4989 Fixed
  #KT-4987 Fixed
2014-10-03 17:24:14 +04:00

6 lines
157 B
Kotlin

fun box(): String {
fun Int?.inc() = (this ?: 0) + 1
var counter: Int? = null
counter++
return if (counter == 1) "OK" else "fail: $counter"
}