Commit 50e2d48e authored by Robert Bradshaw's avatar Robert Bradshaw

Better error message for bad type parameter deduction.

parent f3f7980d
...@@ -4078,7 +4078,7 @@ def best_match(args, functions, pos=None, env=None): ...@@ -4078,7 +4078,7 @@ def best_match(args, functions, pos=None, env=None):
[pattern.type.deduce_template_params(actual) for (pattern, actual) in zip(func_type.args, arg_types)], [pattern.type.deduce_template_params(actual) for (pattern, actual) in zip(func_type.args, arg_types)],
{}) {})
if deductions is None: if deductions is None:
errors.append((func, "Unable to deduce type parameters")) errors.append((func, "Unable to deduce type parameters for %s given %s" % (pattern.type, actual)))
elif len(deductions) < len(func_type.templates): elif len(deductions) < len(func_type.templates):
errors.append((func, "Unable to deduce type parameter %s" % ( errors.append((func, "Unable to deduce type parameter %s" % (
", ".join([param.name for param in set(func_type.templates) - set(deductions.keys())])))) ", ".join([param.name for param in set(func_type.templates) - set(deductions.keys())]))))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment