when generating coercion, take into account the original type of the expression

This commit is contained in:
Dmitry Jemerov
2015-03-05 11:21:44 +01:00
parent 5370073c05
commit 2767e789fb
3 changed files with 16 additions and 1 deletions
@@ -0,0 +1,8 @@
fun box(): String {
val x: Any = 'A'
var y = 0
if (x is Char) {
y = x.toInt()
}
return if (y == 65) "OK" else "fail"
}