DIP 1015--Deprecation of Implicit Conversion of Int. & Char. Literals to bool--Formal Assement

Steven Schveighoffer schveiguy at gmail.com
Wed Nov 14 18:40:46 UTC 2018


On 11/14/18 1:11 PM, Neia Neutuladh wrote:
> On Tue, 13 Nov 2018 20:27:05 -0800, Walter Bright wrote:
>> There have been various attempts over the years to "fix" various things
>> in the D matching system by adding "just one more" match level.
> 
> I kind of feel like, if something would be confusing like this, maybe the
> compiler shouldn't be making an automatic decision. Not "just one more"
> match level, but just...don't match. If there are multiple matching
> overloads, just error out. Don't try to be clever and surprise people,
> just tell the user to be more explicit.
> 

You don't think this is confusing?

enum A : int
{
     val
}

A a;
foo(a); // error: be more specific
int x = a;
foo(x); // Sure

-Steve


More information about the Digitalmars-d-announce mailing list