Tests for import class action added

This commit is contained in:
svtk
2011-09-28 11:58:55 +04:00
parent a06aa17a5f
commit 70d4826317
18 changed files with 158 additions and 14 deletions
@@ -526,6 +526,9 @@ public class BodyResolver {
if (propertyDescriptor.getModality() == Modality.ABSTRACT) {
JetType returnType = propertyDescriptor.getReturnType();
if (returnType instanceof DeferredType) {
returnType = ((DeferredType) returnType).getActualType();
}
JetExpression initializer = property.getInitializer();
if (initializer != null) {
@@ -575,7 +578,11 @@ public class BodyResolver {
}
if (inTrait) {
// context.getTrace().getErrorHandler().genericError(initializer.getNode(), "Property initializers are not allowed in traits");
context.getTrace().report(PROPERTY_INITIALIZER_IN_TRAIT.on(property, initializer, propertyDescriptor.getReturnType()));
JetType returnType = propertyDescriptor.getReturnType();
if (returnType instanceof DeferredType) {
returnType = ((DeferredType) returnType).getActualType();
}
context.getTrace().report(PROPERTY_INITIALIZER_IN_TRAIT.on(property, initializer, returnType));
}
else if (!backingFieldRequired) {
// context.getTrace().getErrorHandler().genericError(initializer.getNode(), "Initializer is not allowed here because this property has no backing field");
@@ -177,7 +177,7 @@ public class ErrorUtils {
}
public static boolean isError(@NotNull DeclarationDescriptor candidate) {
return candidate.getContainingDeclaration() == getErrorClass();
return candidate.getContainingDeclaration() == getErrorClass() || candidate == ERROR_MODULE;
}
private static class ErrorTypeImpl implements JetType {