KT-2739 Error type inferred for hashSet(Pair, Pair, Pair)

#KT-2739 Fixed
This commit is contained in:
Andrey Breslav
2012-09-07 18:24:12 +04:00
parent 213157a3c5
commit b46187a560
5 changed files with 43 additions and 8 deletions
@@ -798,9 +798,12 @@ public class CallResolver {
JetType effectiveExpectedType = getEffectiveExpectedType(valueParameterDescriptor, valueArgument);
TemporaryBindingTrace traceForUnknown = TemporaryBindingTrace.create(context.trace);
JetExpression argumentExpression = valueArgument.getArgumentExpression();
JetType type = argumentExpression != null ? expressionTypingServices.getType(
context.scope, argumentExpression, substitutor.substitute(valueParameterDescriptor.getType(), Variance.INVARIANT),
context.dataFlowInfo, traceForUnknown) : null;
JetType type = argumentExpression != null
? expressionTypingServices.getType(
context.scope, argumentExpression,
substitutor.substitute(effectiveExpectedType, Variance.INVARIANT),
context.dataFlowInfo, traceForUnknown)
: null;
constraintSystem.addSupertypeConstraint(effectiveExpectedType, type, ConstraintPosition.getValueParameterPosition(
valueParameterDescriptor.getIndex()));
//todo no return