mark 'unresolved' if invoke method on type parameter
instead of resolve to error element
This commit is contained in:
+13
-2
@@ -67,7 +67,7 @@ public class CallExpressionResolver {
|
||||
@Nullable
|
||||
private JetType lookupNamespaceOrClassObject(@NotNull JetSimpleNameExpression expression, @NotNull ResolutionContext context) {
|
||||
Name referencedName = expression.getReferencedNameAsName();
|
||||
ClassifierDescriptor classifier = context.scope.getClassifier(referencedName);
|
||||
final ClassifierDescriptor classifier = context.scope.getClassifier(referencedName);
|
||||
if (classifier != null) {
|
||||
JetType classObjectType = classifier.getClassObjectType();
|
||||
if (classObjectType != null) {
|
||||
@@ -103,7 +103,18 @@ public class CallExpressionResolver {
|
||||
JetScope scopeForStaticMembersResolution =
|
||||
classifier instanceof ClassDescriptor
|
||||
? getStaticNestedClassesScope((ClassDescriptor) classifier)
|
||||
: ErrorUtils.createErrorScope("Error scope for type parameter on the left hand side of dot");
|
||||
: new JetScopeImpl() {
|
||||
@NotNull
|
||||
@Override
|
||||
public DeclarationDescriptor getContainingDeclaration() {
|
||||
return classifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Scope for the type parameter on the left hand side of dot";
|
||||
}
|
||||
};
|
||||
return new NamespaceType(referencedName, scopeForStaticMembersResolution);
|
||||
}
|
||||
temporaryTrace.commit();
|
||||
|
||||
@@ -3,6 +3,6 @@ package bar
|
||||
class S<T> {
|
||||
fun foo() {
|
||||
<!TYPE_PARAMETER_IS_NOT_AN_EXPRESSION, UNUSED_EXPRESSION!>T<!>
|
||||
<!TYPE_PARAMETER_ON_LHS_OF_DOT!>T<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>create<!>()
|
||||
<!TYPE_PARAMETER_ON_LHS_OF_DOT!>T<!>.<!UNRESOLVED_REFERENCE!>create<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user