use fresh vars in place of _|_ when incorrect # of params supplied
This commit is contained in:
@@ -2362,11 +2362,13 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
|
||||
} else {
|
||||
"s were"
|
||||
}]);
|
||||
// HACK: build an arguments list with dummy arguments to
|
||||
// check against
|
||||
let dummy = {mode: ast::expl(ast::by_ref),
|
||||
ty: ty::mk_bot(fcx.ccx.tcx)};
|
||||
arg_tys = vec::from_elem(supplied_arg_count, dummy);
|
||||
|
||||
// Just use fresh type variables for the types,
|
||||
// since we don't know them.
|
||||
arg_tys = vec::from_fn(supplied_arg_count) {|_i|
|
||||
{mode: ast::expl(ast::by_ref),
|
||||
ty: next_ty_var(fcx)}
|
||||
};
|
||||
}
|
||||
|
||||
// Check the arguments.
|
||||
|
||||
Reference in New Issue
Block a user