Use throwException() instead of manually created instance
This commit is contained in:
@@ -176,10 +176,7 @@ class SingleInstructionInterpreter(private val eval: Eval) : Interpreter<Value>(
|
|||||||
ObjectValue(value.obj, targetType)
|
ObjectValue(value.obj, targetType)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw ThrownFromEvalException(ObjectValue(
|
throwException(ClassCastException("Value '$value' cannot be cast to $targetType"))
|
||||||
ClassCastException("Value '$value' cannot be cast to $targetType"),
|
|
||||||
Type.getType(javaClass<ClassCastException>())
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user