Prevent lazy types to be accidentally computed in debug

This commit is contained in:
Andrey Breslav
2013-10-28 15:50:30 +04:00
parent c94b658462
commit cc1d8448ed
2 changed files with 11 additions and 1 deletions
@@ -47,4 +47,14 @@ abstract class LazyType(storageManager: StorageManager) : AbstractJetType() {
override fun isError()= getConstructor().getDeclarationDescriptor().inn({ d -> ErrorUtils.isError(d)}, false)
override fun getAnnotations(): List<AnnotationDescriptor> = listOf()
override fun toString(): String? {
if (!_typeConstructor.isComputed()) {
return "Type constructor is not computed"
}
if (!_arguments.isComputed()) {
return "" + getConstructor() + "<arguments are not computed>"
}
return super<AbstractJetType>.toString()
}
}
@@ -41,7 +41,7 @@ public abstract class AbstractJetType implements JetType {
}
@Override
public final String toString() {
public String toString() {
List<TypeProjection> arguments = getArguments();
return getConstructor() + (arguments.isEmpty() ? "" : "<" + argumentsToString(arguments) + ">") + (isNullable() ? "?" : "");
}