nullability tweaks
This commit is contained in:
@@ -1378,9 +1378,10 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
|
||||
}
|
||||
}
|
||||
//noinspection ConstantConditions
|
||||
if (isInsideClass &&
|
||||
(propertyDescriptor.getSetter() == null ||
|
||||
propertyDescriptor.getSetter().isDefault() && propertyDescriptor.getSetter().getModality() == Modality.FINAL)) {
|
||||
if (!propertyDescriptor.isVar() || isInsideClass &&
|
||||
(propertyDescriptor.getSetter() == null ||
|
||||
propertyDescriptor.getSetter().isDefault() &&
|
||||
propertyDescriptor.getSetter().getModality() == Modality.FINAL)) {
|
||||
setter = null;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.jet.codegen;
|
||||
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.asm4.Label;
|
||||
import org.jetbrains.asm4.MethodVisitor;
|
||||
@@ -420,7 +421,7 @@ public class FunctionCodegen {
|
||||
GenerationState state,
|
||||
ClassBuilder v,
|
||||
Method jvmSignature,
|
||||
@Nullable FunctionDescriptor functionDescriptor,
|
||||
@NotNull FunctionDescriptor functionDescriptor,
|
||||
OwnerKind kind
|
||||
) {
|
||||
DeclarationDescriptor contextClass = owner.getContextDescriptor().getContainingDeclaration();
|
||||
@@ -431,9 +432,7 @@ public class FunctionCodegen {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean needed = isDefaultNeeded(functionDescriptor);
|
||||
|
||||
if (!needed) {
|
||||
if (!isDefaultNeeded(functionDescriptor)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -908,11 +908,9 @@ public class JetTypeMapper {
|
||||
return new JvmPropertyAccessorSignature(jvmMethodSignature, jvmMethodSignature.getKotlinReturnType());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NotNull
|
||||
public JvmPropertyAccessorSignature mapSetterSignature(PropertyDescriptor descriptor, OwnerKind kind) {
|
||||
if (!descriptor.isVar()) {
|
||||
return null;
|
||||
}
|
||||
assert descriptor.isVar();
|
||||
|
||||
// TODO: generics signature is not always needed
|
||||
BothSignatureWriter signatureWriter = new BothSignatureWriter(BothSignatureWriter.Mode.METHOD, true);
|
||||
|
||||
Reference in New Issue
Block a user