Tests for import class action added
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user