Prevent lazy types to be accidentally computed in debug
This commit is contained in:
+10
@@ -47,4 +47,14 @@ abstract class LazyType(storageManager: StorageManager) : AbstractJetType() {
|
|||||||
override fun isError()= getConstructor().getDeclarationDescriptor().inn({ d -> ErrorUtils.isError(d)}, false)
|
override fun isError()= getConstructor().getDeclarationDescriptor().inn({ d -> ErrorUtils.isError(d)}, false)
|
||||||
|
|
||||||
override fun getAnnotations(): List<AnnotationDescriptor> = listOf()
|
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
|
@Override
|
||||||
public final String toString() {
|
public String toString() {
|
||||||
List<TypeProjection> arguments = getArguments();
|
List<TypeProjection> arguments = getArguments();
|
||||||
return getConstructor() + (arguments.isEmpty() ? "" : "<" + argumentsToString(arguments) + ">") + (isNullable() ? "?" : "");
|
return getConstructor() + (arguments.isEmpty() ? "" : "<" + argumentsToString(arguments) + ">") + (isNullable() ? "?" : "");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user