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