D-Programming-Language/dmd — pull request #2335 by donc (2013-07-11 19:50:26+00:00)
Title: 10599 CTFE assert with bad struct initializer

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

This is an ErrorExp propagation/gagging bug which triggers an assert in the CTFE sanity checker.

Errors in struct initializers don't generate error messages when used, but we still need to let the enclosing function know that an error happened.

(Really we should refactor the way errors are done, so that we stop using global.errors to check if an error occurs. The whole thing is a bit hacky. I've done this incrementing via a member function in Global to make it slightly easier to refactor in the future).