On Friday, 28 June 2013 at 01:40:44 UTC, Andrej Mitrovic wrote:
Note that if we implement Issue 8728[1], we could even create a better
error message via:

-----
struct S
{
@disable("S is an opaque C type and must only be used as a pointer")
    this();

@disable("S is an opaque C type and must only be used as a pointer")
    this(this);
}

void main()
{
    S* s1;  // ok
    S s2;  // user error
}
-----

[1] : http://d.puremagic.com/issues/show_bug.cgi?id=8728

+1. Anything that makes error messages clearer is a win in my book and there is precedents for it in @deprecate(msg) which was a clear win.

Reply via email to