Coercion fix
This commit is contained in:
@@ -390,8 +390,8 @@ public abstract class StackValue {
|
||||
return new FieldForSharedVar(field.type, field.owner, field.name, newSharedVarReceiver);
|
||||
}
|
||||
|
||||
public static StackValue coercion(@NotNull StackValue receiver, @NotNull Type type) {
|
||||
return CodegenPackage.coercion(receiver, type);
|
||||
public static StackValue coercion(@NotNull StackValue value, @NotNull Type castType) {
|
||||
return new CoercionValue(value, castType);
|
||||
}
|
||||
|
||||
public static StackValue thisOrOuter(@NotNull ExpressionCodegen codegen, @NotNull ClassDescriptor descriptor, boolean isSuper, boolean isExplicit) {
|
||||
|
||||
@@ -21,17 +21,14 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
import org.jetbrains.org.objectweb.asm.Label
|
||||
import org.jetbrains.jet.codegen.StackValue.StackValueWithSimpleReceiver
|
||||
|
||||
public fun coercion(value: StackValue, castType: Type): StackValue {
|
||||
return CoercionValue(value, castType)
|
||||
}
|
||||
|
||||
class CoercionValue(
|
||||
val value: StackValue,
|
||||
val castType: Type
|
||||
) : StackValue(castType) {
|
||||
|
||||
override fun putSelector(type: Type, v: InstructionAdapter) {
|
||||
value.putSelector(type, v)
|
||||
value.putSelector(castType, v)
|
||||
StackValue.coerce(castType, type, v)
|
||||
}
|
||||
|
||||
override fun storeSelector(topOfStackType: Type, v: InstructionAdapter) {
|
||||
|
||||
Reference in New Issue
Block a user