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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 23 04:21:27 PDT 2013


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



--- Comment #23 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-09-23 04:21:26 PDT ---
(In reply to comment #22)
> > ...rules you wouldn't be able to apply to normal functions. For example an
> "enforce" that refuses array literals. Can't happen.
> 
> Actually it's the other way around. Currently, assert is special.
> 
> void enforce(bool b, string msg = "xxx")
> {
> }
> 
> void main()
> {
>    enforce("zzz");
> }
> 
> 
> zunk.d(8): Error: function zunk.enforce (bool b, string msg = "xxx") is not
> callable using argument types (string)

That's not the Phobos enforce. This is:

-----
import std.exception;

void main()
{
   enforce("zzz");  // works fine
}
-----

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