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;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||
@@ -25,9 +24,6 @@ public interface CallableDescriptor extends DeclarationDescriptor {
|
||||
@NotNull
|
||||
JetType getReturnType();
|
||||
|
||||
@Nullable
|
||||
JetType getReturnTypeSafe();
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
CallableDescriptor getOriginal();
|
||||
|
||||
@@ -125,12 +125,6 @@ public class FunctionDescriptorImpl extends DeclarationDescriptorImpl implements
|
||||
return unsubstitutedReturnType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public JetType getReturnTypeSafe() {
|
||||
return unsubstitutedReturnType;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FunctionDescriptor getOriginal() {
|
||||
|
||||
@@ -119,11 +119,6 @@ public class PropertyDescriptor extends VariableDescriptorImpl implements Callab
|
||||
return getOutType();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public JetType getReturnTypeSafe() {
|
||||
return getOutType();
|
||||
}
|
||||
|
||||
public boolean isVar() {
|
||||
return isVar;
|
||||
|
||||
@@ -40,12 +40,6 @@ public class PropertyGetterDescriptor extends PropertyAccessorDescriptor {
|
||||
return returnType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public JetType getReturnTypeSafe() {
|
||||
return returnType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
||||
return visitor.visitPropertyGetterDescriptor(this, data);
|
||||
|
||||
@@ -48,11 +48,6 @@ public class PropertySetterDescriptor extends PropertyAccessorDescriptor {
|
||||
return JetStandardClasses.getUnitType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JetType getReturnTypeSafe() {
|
||||
return getReturnType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
||||
return visitor.visitPropertySetterDescriptor(this, data);
|
||||
|
||||
@@ -89,10 +89,4 @@ public abstract class VariableDescriptorImpl extends DeclarationDescriptorImpl i
|
||||
public JetType getReturnType() {
|
||||
return getOutType();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public JetType getReturnTypeSafe() {
|
||||
return getOutType();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,11 +73,7 @@ public class DescriptorRenderer implements Renderer {
|
||||
}
|
||||
|
||||
public String renderType(JetType type) {
|
||||
if (type == null) {
|
||||
return escape("<?>");
|
||||
} else {
|
||||
return escape(type.toString());
|
||||
}
|
||||
return escape(type.toString());
|
||||
}
|
||||
|
||||
protected String escape(String s) {
|
||||
@@ -226,7 +222,8 @@ public class DescriptorRenderer implements Renderer {
|
||||
|
||||
renderName(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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user