attempt to fix KT-2251

This commit is contained in:
Alex Tkachman
2012-09-18 14:25:09 +03:00
parent 20f1ddc9da
commit 0ffc8f355b
4 changed files with 67 additions and 22 deletions
@@ -0,0 +1,33 @@
fun box() : String {
var x = 20.toByte()
var y = 20.toByte()
val foo = {
x++
++x
}
if(++x != 21.toByte() || x++ != 21.toByte() || foo() != 24.toByte() || x != 24.toByte()) return "shared byte fail"
if(++y != 21.toByte() || y++ != 21.toByte() || y != 22.toByte()) return "byte fail"
var xs = 20.toShort()
var ys = 20.toShort()
val foos = {
xs++
++xs
}
if(++xs != 21.toShort() || xs++ != 21.toShort() || foos() != 24.toShort() || xs != 24.toShort()) return "shared short fail"
if(++ys != 21.toShort() || ys++ != 21.toShort() || ys != 22.toShort()) return "short fail"
var xc = 20.toChar()
var yc = 20.toChar()
val fooc = {
xc++
++xc
}
if(++xc != 21.toChar() || xc++ != 21.toChar() || fooc() != 24.toChar() || xc != 24.toChar()) return "shared char fail"
if(++yc != 21.toChar() || yc++ != 21.toChar() || yc != 22.toChar()) return "char fail"
return "OK"
}