[Issue 692] rules for assigning to complex types are too strict

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 26 22:18:58 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=692


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #5 from Don <clugdbug at yahoo.com.au> 2010-11-26 22:17:30 PST ---
> I don't see any good reason for this strictness.
There is a good reason. It was a deliberate decision.
I do not know how the rules could be weakened, without major changes to the
lookup rules.

Originally, the test cases did compile. But the problem is, with the broken
implicit conversion rules we've inherited from C, it interferes with function
overloading in a horrible way.

Consider:
void foo(real x);

Then you add
void foo(creal x);

And suddenly foo(7.0); doesn't compile any more.

The implicit conversions real -> creal were removed for this reason. It's the
lesser of two evils.

Now, I've been planning a proposal for changing the implicit conversion rules
for numeric literals, and possibly that make this possible as well. But it's a
big change, even for D2.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list