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
@@ -26,7 +26,8 @@ class CoercionValue(
) : StackValue(castType, value.canHaveSideEffects()) {
override fun putSelector(type: Type, v: InstructionAdapter) {
value.putSelector(castType, v)
value.putSelector(value.type, v)
StackValue.coerce(value.type, castType, v)
StackValue.coerce(castType, type, v)
}