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 04b24c18f0d..74b96d02905 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java @@ -591,6 +591,9 @@ 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; diff --git a/compiler/testData/diagnostics/tests/classLiteral/nonClassesOnLHS.kt b/compiler/testData/diagnostics/tests/classLiteral/nonClassesOnLHS.kt index 2cf9f7462bd..4d9cc30c43d 100644 --- a/compiler/testData/diagnostics/tests/classLiteral/nonClassesOnLHS.kt +++ b/compiler/testData/diagnostics/tests/classLiteral/nonClassesOnLHS.kt @@ -13,4 +13,4 @@ fun foo() { val t2 = T?::class } -val m = Map::class +val m = Map::class \ No newline at end of file