Dream Feature Regarding Default Arguments
Nick Sabalausky
SeeWebsiteToContactMe at semitwist.com
Sat Apr 5 18:33:32 PDT 2014
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.
More information about the Digitalmars-d
mailing list