diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java index 74b96d02905..49f3f209d48 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java @@ -554,6 +554,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor { } else { JetType actualType = possiblyBareType.getActualType(); + if (actualType.isError()) return null; if (isAllowedInClassLiteral(actualType)) { type = actualType; } @@ -591,9 +592,6 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor { TypeConstructor typeConstructor = type.getConstructor(); ClassifierDescriptor typeDeclarationDescriptor = typeConstructor.getDeclarationDescriptor(); - // no need to report error if unresolved - if (typeDeclarationDescriptor == null || ErrorUtils.isError(typeDeclarationDescriptor)) return true; - if (typeDeclarationDescriptor instanceof ClassDescriptor) { List parameters = typeConstructor.getParameters(); if (parameters.size() != type.getArguments().size()) return false;