use of org.ballerinalang.model.tree.expressions.NamedArgNode in project ballerina by ballerina-lang.
the class TypeChecker method checkNamedArgs.
private void checkNamedArgs(List<BLangExpression> namedArgExprs, List<BVarSymbol> defaultableParams) {
for (BLangExpression expr : namedArgExprs) {
BLangIdentifier argName = ((NamedArgNode) expr).getName();
BVarSymbol varSym = defaultableParams.stream().filter(param -> param.getName().value.equals(argName.value)).findAny().orElse(null);
if (varSym == null) {
dlog.error(expr.pos, DiagnosticCode.UNDEFINED_PARAMETER, argName);
break;
}
checkExpr(expr, this.env, Lists.of(varSym.type));
}
}
Aggregations