Return error class in case we are not able to find class for object property
This commit is contained in:
+6
-2
@@ -28,6 +28,7 @@ import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.lazy.storage.StorageManager;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.types.ErrorUtils;
|
||||
import org.jetbrains.jet.lang.types.Variance;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -201,8 +202,11 @@ public class DescriptorDeserializer {
|
||||
FqNameUnsafe fqName = DescriptorUtils.getFQName(containingDeclaration).child(name);
|
||||
ClassId objectId = ClassId.fromFqNameAndContainingDeclaration(fqName, (ClassOrNamespaceDescriptor) containingDeclaration);
|
||||
ClassDescriptor objectClass = typeDeserializer.getDescriptorFinder().findClass(objectId);
|
||||
assert objectClass != null : "Object for property not found: " + name;
|
||||
|
||||
if (objectClass == null) {
|
||||
// if we are not able to find the class for object property
|
||||
// then something bad has happened since they should be in the same jar
|
||||
objectClass = ErrorUtils.createErrorClass(objectId.asSingleFqName().asString());
|
||||
}
|
||||
return new PropertyDescriptorForObjectImpl(containingDeclaration, annotations, visibility, name, objectClass);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user