https://issues.dlang.org/show_bug.cgi?id=17351

--- Comment #8 from [email protected] ---
(In reply to Andrei Alexandrescu from comment #6)
> Now, Lucia (@somzzz) has gotten to the point where it all passes druntime
> and phobos unittests, but breaks in exactly one point in the compiler. It
> can be reduced to this:
> 
> static const int[3] x = [1, 2, 3];
> static assert(x == x);

Got it. You need the special overload behavior to keep that assert working with
the new implementation. I'm not particularly opposed to tweaking overload
resolution to that end.

However, as mentioned, another option could be to disallow that static assert
on the grounds that x being static const doesn't mean it's a compile-time
constant. I realize that this would be a relatively disruptive change, but it
would simplify the language instead of complicating it further.

It would also make this little gem impossible:

----
void main()
{
    const bool x = __ctfe;
    static const bool y = x;
    static assert(x == y); /* passes */
    assert(x == y); /* fails */
}
----

--

Reply via email to