D-Programming-Language/dmd — pull request #1728 by 9rnsr (2013-03-08 09:30:55+00:00)
Title: Issue 9650 - __traits(compiles) + mixin

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

I couldn't minimize test case, but the bug fix is obvious.

The bug had been hiding for a long time, but recent Phobos change (https://github.com/D-Programming-Language/phobos/commit/2a88fea7867f33fd1cf15c2dca7790a3c8aea474) had exposed the bug.

When a mixin expression gets invalid code string, the parsing error had not handled correctly. In such case, it had generated *invalid* AST instead of returning ErrorExp. I guess that the invalid AST would report weird error in later semantic analysis.

I think that both CompileDeclaration and CompileStatement do not have same problem. So they are not changed.