DIP 52 - Implicit conversions

Jakob Ovrum jakobovrum at gmail.com
Fri Dec 13 05:14:56 PST 2013


On Wednesday, 11 December 2013 at 15:28:51 UTC, bearophile wrote:
> Simen Kjærås:
>
>> http://wiki.dlang.org/DIP52
>
>> However, given that this code compiles and works perfectly:
>> 
>> void baz() {
>>   import std.typecons;
>>   Tuple!(int, int) a;
>>   Tuple!(int, "x", int, "y") b;
>>   a = b; // Implicit conversion to less specialized type.
>>   b = a; // Implicit conversion to more specialized type.
>
> I think "b = a;" is an accepts-invalid bug.

It's not. It works because of the user-defined Tuple.opAssign.


More information about the Digitalmars-d mailing list