[Issue 7046] CTFE: append null does nothing

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 2 07:48:24 PST 2011


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



--- Comment #6 from Adam D. Ruppe <destructionator at gmail.com> 2011-12-02 07:47:17 PST ---
(In reply to comment #2)
> I mean a null could mean a null string[], not a null string.

I oversimplified the test - in the original code it came from,
it was more like

string a = null;
ret ~= a;

which gets the same result in 2.056

I haven't tried git though. I'm not sure how to use that yet!

> I almost think the code in question should fail to compile for being too
> ambiguous.

With null itself... maybe. In the case of string[], ~= null could
have two meanings, but one of them is pretty obviously a no-op, so it's
probably not what you meant.

If a variable happens to be null, maybe doing nothing is what you wanted,
but in that case, the variable has an exact type declared so it's not
ambiguous anymore.

-- 
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