KT-9950 IntelliJ IDEA does not suggest importing extension methods which have the same name as an instance method

#KT-9950 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-10-05 19:03:05 +03:00
parent 49ac6b99f6
commit 5734f2ba9b
21 changed files with 794 additions and 55 deletions
@@ -34,9 +34,20 @@ public class ExpressionTypingContext extends ResolutionContext<ExpressionTypingC
@NotNull LexicalScope scope,
@NotNull DataFlowInfo dataFlowInfo,
@NotNull KotlinType expectedType
) {
return newContext(trace, scope, dataFlowInfo, expectedType, ContextDependency.INDEPENDENT);
}
@NotNull
public static ExpressionTypingContext newContext(
@NotNull BindingTrace trace,
@NotNull LexicalScope scope,
@NotNull DataFlowInfo dataFlowInfo,
@NotNull KotlinType expectedType,
@NotNull ContextDependency contextDependency
) {
return newContext(trace, scope, dataFlowInfo, expectedType,
ContextDependency.INDEPENDENT, new ResolutionResultsCacheImpl(),
contextDependency, new ResolutionResultsCacheImpl(),
StatementFilter.NONE, false);
}
@@ -30,8 +30,6 @@ import org.jetbrains.kotlin.resolve.*;
import org.jetbrains.kotlin.resolve.calls.context.ContextDependency;
import org.jetbrains.kotlin.resolve.calls.context.ResolutionContext;
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo;
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValue;
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory;
import org.jetbrains.kotlin.resolve.scopes.LexicalScope;
import org.jetbrains.kotlin.resolve.scopes.LexicalScopeKind;
import org.jetbrains.kotlin.resolve.scopes.LexicalWritableScope;
@@ -93,7 +91,7 @@ public class ExpressionTypingServices {
@NotNull BindingTrace trace,
boolean isStatement
) {
return getTypeInfo(scope, expression, expectedType, dataFlowInfo, trace, isStatement, expression);
return getTypeInfo(scope, expression, expectedType, dataFlowInfo, trace, isStatement, expression, ContextDependency.INDEPENDENT);
}
@NotNull
@@ -104,10 +102,11 @@ public class ExpressionTypingServices {
@NotNull DataFlowInfo dataFlowInfo,
@NotNull BindingTrace trace,
boolean isStatement,
@NotNull final KtExpression contextExpression
@NotNull final KtExpression contextExpression,
@NotNull ContextDependency contextDependency
) {
ExpressionTypingContext context = ExpressionTypingContext.newContext(
trace, scope, dataFlowInfo, expectedType
trace, scope, dataFlowInfo, expectedType, contextDependency
);
if (contextExpression != expression) {
context = context.replaceExpressionContextProvider(new Function1<KtExpression, KtExpression>() {