Fix assertions generation for substituted members
This commit is contained in:
@@ -571,7 +571,7 @@ public class AsmUtil {
|
||||
) {
|
||||
if (!state.isGenerateNotNullAssertions()) return;
|
||||
|
||||
if (!Boolean.TRUE.equals(state.getBindingContext().get(BindingContext.IS_DECLARED_IN_JAVA, descriptor))) return;
|
||||
if (!isDeclaredInJava(descriptor, state.getBindingContext())) return;
|
||||
|
||||
JetType type = descriptor.getReturnType();
|
||||
if (type == null || type.isNullable()) return;
|
||||
@@ -585,6 +585,19 @@ public class AsmUtil {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isDeclaredInJava(@NotNull CallableDescriptor callableDescriptor, @NotNull BindingContext context) {
|
||||
CallableDescriptor descriptor = callableDescriptor;
|
||||
while (true) {
|
||||
if (Boolean.TRUE.equals(context.get(BindingContext.IS_DECLARED_IN_JAVA, descriptor))) {
|
||||
return true;
|
||||
}
|
||||
CallableDescriptor original = descriptor.getOriginal();
|
||||
if (descriptor == original) break;
|
||||
descriptor = original;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void pushDefaultValueOnStack(@NotNull Type type, @NotNull InstructionAdapter v) {
|
||||
if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
|
||||
v.aconst(null);
|
||||
|
||||
Reference in New Issue
Block a user