Various code improvements (missing annotations, dead code elimination) in the classes touched by previous commit.
This commit is contained in:
@@ -27,7 +27,10 @@ import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ExtensionReceiver;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.TransientReceiver;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
import org.jetbrains.jet.lang.types.DescriptorSubstitutor;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||
import org.jetbrains.jet.lang.types.Variance;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -53,16 +56,6 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
private List<TypeParameterDescriptor> typeParameters;
|
||||
private PropertyGetterDescriptor getter;
|
||||
private PropertySetterDescriptor setter;
|
||||
|
||||
private PropertyDescriptor() {
|
||||
super(ErrorUtils.getErrorClass(), Collections.<AnnotationDescriptor>emptyList(), Name.special("<dummy>"));
|
||||
this.modality = null;
|
||||
this.visibility = null;
|
||||
this.isVar = false;
|
||||
this.isObject = false;
|
||||
this.original = null;
|
||||
this.kind = Kind.DECLARATION;
|
||||
}
|
||||
|
||||
private PropertyDescriptor(
|
||||
@Nullable PropertyDescriptor original,
|
||||
@@ -73,7 +66,7 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
boolean isVar,
|
||||
boolean isObject,
|
||||
@NotNull Name name,
|
||||
Kind kind) {
|
||||
@NotNull Kind kind) {
|
||||
super(containingDeclaration, annotations, name);
|
||||
this.isVar = isVar;
|
||||
this.isObject = isObject;
|
||||
@@ -91,7 +84,7 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
boolean isVar,
|
||||
boolean isObject,
|
||||
@NotNull Name name,
|
||||
Kind kind) {
|
||||
@NotNull Kind kind) {
|
||||
this(null, containingDeclaration, annotations, modality, visibility, isVar, isObject, name, kind);
|
||||
}
|
||||
|
||||
@@ -106,7 +99,7 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
@NotNull ReceiverDescriptor expectedThisObject,
|
||||
@NotNull Name name,
|
||||
@NotNull JetType outType,
|
||||
Kind kind
|
||||
@NotNull Kind kind
|
||||
) {
|
||||
this(containingDeclaration, annotations, modality, visibility, isVar, isObject, name, kind);
|
||||
setType(outType, Collections.<TypeParameterDescriptor>emptyList(), expectedThisObject, receiverType);
|
||||
@@ -143,6 +136,7 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
return typeParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ReceiverDescriptor getReceiverParameter() {
|
||||
return receiver;
|
||||
@@ -154,11 +148,13 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
return expectedThisObject;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public JetType getReturnType() {
|
||||
return getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVar() {
|
||||
return isVar;
|
||||
}
|
||||
@@ -309,8 +305,4 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
public PropertyDescriptor copy(DeclarationDescriptor newOwner, Modality modality, boolean makeInvisible, Kind kind, boolean copyOverrides) {
|
||||
return doSubstitute(TypeSubstitutor.EMPTY, newOwner, modality, makeInvisible ? Visibilities.INVISIBLE_FAKE : visibility, false, copyOverrides, kind);
|
||||
}
|
||||
|
||||
public static PropertyDescriptor createDummy() {
|
||||
return new PropertyDescriptor();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ public class PropertyGetterDescriptor extends PropertyAccessorDescriptor {
|
||||
@NotNull Visibility visibility,
|
||||
boolean hasBody,
|
||||
boolean isDefault,
|
||||
Kind kind) {
|
||||
@NotNull Kind kind) {
|
||||
this(correspondingProperty, annotations, modality, visibility, hasBody, isDefault, kind, null);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class PropertyGetterDescriptor extends PropertyAccessorDescriptor {
|
||||
@NotNull Visibility visibility,
|
||||
boolean hasBody,
|
||||
boolean isDefault,
|
||||
Kind kind,
|
||||
@NotNull Kind kind,
|
||||
@Nullable PropertyGetterDescriptor original)
|
||||
{
|
||||
super(modality, visibility, correspondingProperty, annotations, Name.special("<get-" + correspondingProperty.getName() + ">"), hasBody, isDefault, kind);
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ public class PropertySetterDescriptor extends PropertyAccessorDescriptor {
|
||||
@NotNull Visibility visibility,
|
||||
boolean hasBody,
|
||||
boolean isDefault,
|
||||
Kind kind) {
|
||||
@NotNull Kind kind) {
|
||||
this(correspondingProperty, annotations, modality, visibility, hasBody, isDefault, kind, null);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class PropertySetterDescriptor extends PropertyAccessorDescriptor {
|
||||
@NotNull Visibility visibility,
|
||||
boolean hasBody,
|
||||
boolean isDefault,
|
||||
Kind kind,
|
||||
@NotNull Kind kind,
|
||||
@Nullable PropertySetterDescriptor original) {
|
||||
super(modality, visibility, correspondingProperty, annotations, Name.special("<set-" + correspondingProperty.getName() + ">"), hasBody, isDefault, kind);
|
||||
this.original = original != null ? original : this;
|
||||
|
||||
@@ -99,6 +99,7 @@ public abstract class VariableDescriptorImpl extends DeclarationDescriptorNonRoo
|
||||
return ReceiverDescriptor.NO_RECEIVER;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public JetType getReturnType() {
|
||||
return getType();
|
||||
|
||||
Reference in New Issue
Block a user