mark 'unresolved' if invoke method on type parameter

instead of resolve to error element
This commit is contained in:
Svetlana Isakova
2013-04-12 19:57:42 +04:00
parent 204ffde78a
commit 7588c8d81f
2 changed files with 15 additions and 4 deletions
@@ -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<!>()
}
}
}