Add KotlinType info about this inside inline class

This commit is contained in:
Mikhail Zarechenskiy
2018-02-08 14:18:17 +03:00
parent c86d3e354b
commit 22b9c25dd0
9 changed files with 81 additions and 2 deletions
@@ -2678,8 +2678,8 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
private StackValue generateThisOrOuterFromContext(@NotNull ClassDescriptor thisOrOuterClass, boolean isSuper, boolean forceOuter) {
CodegenContext cur = context;
Type type = asmType(thisOrOuterClass.getDefaultType());
StackValue result = StackValue.local(0, type);
SimpleType thisType = thisOrOuterClass.getDefaultType();
StackValue result = StackValue.local(0, asmType(thisType), thisType);
boolean inStartConstructorContext = cur instanceof ConstructorContext;
while (cur != null) {
ClassDescriptor thisDescriptor = cur.getThisDescriptor();
@@ -151,6 +151,10 @@ public abstract class StackValue {
return new Local(index, type);
}
public static Local local(int index, @NotNull Type type, @Nullable KotlinType kotlinType) {
return new Local(index, type, kotlinType);
}
@NotNull
public static Local local(int index, @NotNull Type type, @NotNull VariableDescriptor descriptor) {
return new Local(index, type, descriptor.getType(), descriptor.isLateInit(), descriptor.getName());
@@ -802,6 +806,10 @@ public abstract class StackValue {
this(index, type, null, false, null);
}
private Local(int index, Type type, KotlinType kotlinType) {
this(index, type, kotlinType, false, null);
}
@Override
public void putSelector(@NotNull Type type, @Nullable KotlinType kotlinType, @NotNull InstructionAdapter v) {
v.load(index, this.type);