Refactor frontend components

Make dependencies more explicit
Move components out of ExpressionTypingServices
Make ExpressionTypingUtils a true utility class, refactor stuff out
Extract new components: FakeCallResolver, MultiDeclarationResolver, ValueParameterResolver
This commit is contained in:
Pavel V. Talanov
2015-04-14 20:39:37 +03:00
parent 50ae8182b8
commit 1a5efacbf3
43 changed files with 1019 additions and 967 deletions
@@ -72,15 +72,15 @@ public class RemoveExplicitTypeArguments : JetSelfTargetingOffsetIndependentInte
TypeUtils.NO_EXPECTED_TYPE
}
val dataFlow = context.getDataFlowInfo(callExpression)
val resolutionResults = injector.getExpressionTypingServices()?.getCallResolver()?.resolveFunctionCall(
val resolutionResults = injector.getCallResolver().resolveFunctionCall(
BindingTraceContext(), scope, untypedCall, jType, dataFlow, false)
assert (resolutionResults?.isSingleResult() ?: true) { "Removing type arguments changed resolve for: " +
"${callExpression.getTextWithLocation()} to ${resolutionResults?.getResultCode()}" }
assert (resolutionResults.isSingleResult()) { "Removing type arguments changed resolve for: " +
"${callExpression.getTextWithLocation()} to ${resolutionResults.getResultCode()}" }
val args = originalCall.getTypeArguments()
val newArgs = resolutionResults?.getResultingCall()?.getTypeArguments()
val newArgs = resolutionResults.getResultingCall().getTypeArguments()
return args == newArgs?.mapValues { approximateFlexibleTypes(it.getValue(), false) }
return args == newArgs.mapValues { approximateFlexibleTypes(it.getValue(), false) }
}
private class CallWithoutTypeArgs(call: Call) : DelegatingCall(call) {