[Issue 11080] assert(`string`) should be forbidden

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 21 01:50:45 PDT 2013


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


monarchdodra at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra at gmail.com


--- Comment #1 from monarchdodra at gmail.com 2013-09-21 01:50:42 PDT ---
Not sure it's valid: What you are seeing is basically a dynamic array
implicitly decaying to its pointer / boolean in a conditional clause. Some
(myself included) judge this feature should be deprecated anyways.

For example, this would be a "legit" use of "assert(string)":
string s;
assert(s);

So, overall, I think you are seeing a "special" case of a more generic problem,
eg:

while ("hello") ...
if ("hello") ...
auto k = "hello" ? ... : ... ;

All of the above I judge ambiguous.

I couldn't find any relevant entries about this, but the "issue" *has* been
beaten to death on the forums:
http://forum.dlang.org/thread/bwgnbflygowctlisistg@forum.dlang.org

Enjoy :)

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