1
Fork 0

Fix ICE when checking call overload

If the overloaded method does not have a tuple or unit type as its
first non-self parameter, produce a list of error types with the
correct length to prevent a later index bound panic.  This typically
occurs due to propagation of an earlier type error or unconstrained
type variable.  Closes #18532
This commit is contained in:
Brian Koropoff 2014-11-02 19:26:14 -08:00
parent b87619e274
commit 1571abae53

View file

@ -2536,7 +2536,7 @@ fn check_argument_types<'a>(fcx: &FnCtxt,
span_err!(tcx.sess, sp, E0059,
"cannot use call notation; the first type parameter \
for the function trait is neither a tuple nor unit");
err_args(supplied_arg_count)
err_args(args.len())
}
}
} else if expected_arg_count == supplied_arg_count {