No report of wrong class literal for unresolved

This commit is contained in:
Valentin Kipyatkov
2015-08-08 12:13:42 +03:00
parent ceae7eda39
commit 7f42c8b482
2 changed files with 4 additions and 1 deletions
@@ -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<TypeParameterDescriptor> parameters = typeConstructor.getParameters();
if (parameters.size() != type.getArguments().size()) return false;
@@ -13,4 +13,4 @@ fun foo<T : Any>() {
val t2 = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>T?::class<!>
}
val m = <!CLASS_LITERAL_LHS_NOT_A_CLASS!>Map<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String><!>::class<!>
val m = Map<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String><!>::class