Return error class in case we are not able to find class for object property

This commit is contained in:
Pavel V. Talanov
2013-09-02 15:30:49 +04:00
parent 2e823d6b7b
commit e4b2e32827
4 changed files with 20 additions and 2 deletions
@@ -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);
}