[Issue 2816] Sudden-death static assert is not very useful

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 7 03:55:46 PDT 2009


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


clugdbug at yahoo.com.au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |




------- Comment #2 from clugdbug at yahoo.com.au  2009-04-07 05:55 -------
(In reply to comment #1)
> The static assert does give you file/line, so it does give context. But I'll
> add the expression print, too.
> 
> But I think static assert errors should be fatal. They usually involve
> misconfigured code, it is pointless to continue.
> 

Yes, there will not be any more meaningful errors. But you still need a back
trace.
If the static assert occurs in (say) a library template, knowing that it
happened in std.functional at line 92 doesn't help very much -- you want to
know where the problem is in _your_ code. (That's a real example, BTW).

Actually, I'll have another try, and see if I can create a backtrace, and THEN
make it a fatal error. So I'm retracting this patch.


-- 



More information about the Digitalmars-d-bugs mailing list