use of org.eclipse.ceylon.compiler.typechecker.tree.Tree.NamedArgument in project ceylon by eclipse.
the class TypeArgumentInference method inferTypeArgumentFromNamedArgs.
private Type inferTypeArgumentFromNamedArgs(TypeParameter tp, ParameterList parameters, Type qt, Tree.NamedArgumentList nal, Declaration invoked) {
boolean findingUpperBounds = isEffectivelyContravariant(tp, invoked, specifiedParameters(nal, parameters), false);
List<NamedArgument> namedArgs = nal.getNamedArguments();
Set<Parameter> foundParameters = new HashSet<Parameter>();
List<Type> inferredTypes = new ArrayList<Type>(namedArgs.size());
for (Tree.NamedArgument arg : namedArgs) {
inferTypeArgFromNamedArg(arg, tp, qt, parameters, findingUpperBounds, inferredTypes, invoked, foundParameters);
}
Parameter sp = getUnspecifiedParameter(null, parameters, foundParameters);
if (sp != null) {
Tree.SequencedArgument sarg = nal.getSequencedArgument();
inferTypeArgFromSequencedArg(sarg, tp, sp, findingUpperBounds, inferredTypes, sarg);
}
return unionOrIntersection(findingUpperBounds, inferredTypes);
}
Aggregations