RE: Overload of Dictionary and Callback - why is this disallowed?

From: Boris Zbarsky [mailto:bzbarsky@mit.edu]

> That said, I think we could, in fact, make callback functions and dictionaries
> distinguishable.  It wouldn't even require any changes to the overload
> resolution algorithm, as far as I can tell:

I think we could, but it would be confusing to allow APIs to be designed that way, and should be discouraged.

> That said, what is the actual use case here?  If this is a new API, you should
> probably just use a dictionary and not create the two overloads.

... and if it's an old API, you should use prose.

Received on Tuesday, 1 December 2015 16:05:51 UTC