On 4/5/2014 9:26 PM, Nick Sabalausky wrote:
It would be *fantastic* if D recognized the disambiguation of using
incompatible types and permitted this:
interface Foo {}
interface Bar {}
class FooBar : Foo, Bar {}
void func(Foo foo=someFoo, Bar bar=someBar) {...}
func(myFoo); // Unambiguous, OK
func(myBar); // Unambiguous, OK
func(myFooBar); // Ambiguous, ERROR
Actually, that last line should be:
func(myFooBar); // Unambiguous, this is still interpreted as the
first parameter (with the second parameter left as default) just as it
is right now.