diff --git a/teavm-core/src/main/java/org/teavm/model/emit/ValueEmitter.java b/teavm-core/src/main/java/org/teavm/model/emit/ValueEmitter.java index 444190983..1b1e74023 100644 --- a/teavm-core/src/main/java/org/teavm/model/emit/ValueEmitter.java +++ b/teavm-core/src/main/java/org/teavm/model/emit/ValueEmitter.java @@ -707,7 +707,7 @@ public class ValueEmitter { value = castToInteger(sourceSubtype); } NumericOperandType sourceNumeric = convertToNumeric(sourceKind); - NumericOperandType targetNumeric = convertToNumeric(sourceKind); + NumericOperandType targetNumeric = convertToNumeric(targetKind); CastNumberInstruction insn = new CastNumberInstruction(sourceNumeric, targetNumeric); insn.setValue(value.getVariable());