Revert "fix DescriptionRenderer failure if FunctionDescriptor.getReturnType returns null"
Problem will be fixed by removing @NotNull modifier.
This reverts commit fed075b0ca.
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
package org.jetbrains.jet.lang.descriptors;
|
package org.jetbrains.jet.lang.descriptors;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||||
@@ -25,9 +24,6 @@ public interface CallableDescriptor extends DeclarationDescriptor {
|
|||||||
@NotNull
|
@NotNull
|
||||||
JetType getReturnType();
|
JetType getReturnType();
|
||||||
|
|
||||||
@Nullable
|
|
||||||
JetType getReturnTypeSafe();
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
CallableDescriptor getOriginal();
|
CallableDescriptor getOriginal();
|
||||||
|
|||||||
@@ -125,12 +125,6 @@ public class FunctionDescriptorImpl extends DeclarationDescriptorImpl implements
|
|||||||
return unsubstitutedReturnType;
|
return unsubstitutedReturnType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Nullable
|
|
||||||
public JetType getReturnTypeSafe() {
|
|
||||||
return unsubstitutedReturnType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public FunctionDescriptor getOriginal() {
|
public FunctionDescriptor getOriginal() {
|
||||||
|
|||||||
@@ -119,11 +119,6 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
|||||||
return getOutType();
|
return getOutType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Nullable
|
|
||||||
public JetType getReturnTypeSafe() {
|
|
||||||
return getOutType();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isVar() {
|
public boolean isVar() {
|
||||||
return isVar;
|
return isVar;
|
||||||
|
|||||||
@@ -40,12 +40,6 @@ public class PropertyGetterDescriptor extends PropertyAccessorDescriptor {
|
|||||||
return returnType;
|
return returnType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Nullable
|
|
||||||
public JetType getReturnTypeSafe() {
|
|
||||||
return returnType;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
||||||
return visitor.visitPropertyGetterDescriptor(this, data);
|
return visitor.visitPropertyGetterDescriptor(this, data);
|
||||||
|
|||||||
@@ -48,11 +48,6 @@ public class PropertySetterDescriptor extends PropertyAccessorDescriptor {
|
|||||||
return JetStandardClasses.getUnitType();
|
return JetStandardClasses.getUnitType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public JetType getReturnTypeSafe() {
|
|
||||||
return getReturnType();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
||||||
return visitor.visitPropertySetterDescriptor(this, data);
|
return visitor.visitPropertySetterDescriptor(this, data);
|
||||||
|
|||||||
@@ -89,10 +89,4 @@ public abstract class VariableDescriptorImpl extends DeclarationDescriptorImpl i
|
|||||||
public JetType getReturnType() {
|
public JetType getReturnType() {
|
||||||
return getOutType();
|
return getOutType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Nullable
|
|
||||||
public JetType getReturnTypeSafe() {
|
|
||||||
return getOutType();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,11 +73,7 @@ public class DescriptorRenderer implements Renderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String renderType(JetType type) {
|
public String renderType(JetType type) {
|
||||||
if (type == null) {
|
return escape(type.toString());
|
||||||
return escape("<?>");
|
|
||||||
} else {
|
|
||||||
return escape(type.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String escape(String s) {
|
protected String escape(String s) {
|
||||||
@@ -226,7 +222,8 @@ public class DescriptorRenderer implements Renderer {
|
|||||||
|
|
||||||
renderName(descriptor, builder);
|
renderName(descriptor, builder);
|
||||||
renderValueParameters(descriptor, builder);
|
renderValueParameters(descriptor, builder);
|
||||||
builder.append(" : ").append(escape(renderType(descriptor.getReturnTypeSafe())));
|
// TODO: getReturnType may be uninitialized and throw IllegalStateException // stepan.koltsov@ 2011-11-21
|
||||||
|
builder.append(" : ").append(escape(renderType(descriptor.getReturnType())));
|
||||||
return super.visitFunctionDescriptor(descriptor, builder);
|
return super.visitFunctionDescriptor(descriptor, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user