Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cross( (1,2,3), (4,5,6), :with(42) ) would die with the perplexing error message: "Unexpected named argument 'with' passed". This is caused by the candidate that *does* accept :with has a Callable constraint on it. And since 42 is not a Callable, that candidate is not selected, so the next candidate is, except for the fact that that candidate does not accept a :with named parameter. By removing the Callable constraint on the :with! candidate, the error becomes: Type check failed in binding to parameter '&op'; expected Callable but got Int (42). Still not pretty, but a lot less perplexing. Only other alternative would be to create an additional candidate just to be able to create a more awesome error message. It's been done before, but this doesn't feel like it is too much of a beginners trap. Although a beginner found it: https://stackoverflow.com/questions/62202221/how-do-i-take-a-reference-to-new/62202837#62202837
- Loading branch information