D-Programming-Language/dmd — pull request #587 by 9rnsr (2011-12-27 17:19:10+00:00)
Title: Issue 7173 - dmd: glue.c:1065: virtual unsigned int Type::totym(): Assertion `0' failed.

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

This is `trySemantic` + `Expression::rvalue()` problem.

First, an AssignExp `b3 = (b1 - b2).fun();` tries call `AssignExp::op_overload`, but B does not have `opAssign`.
Next, AssignExp::op_overload tries to semantic of `b3._a = (b1 - b2).fun();` to resolve alias this.
But in this second `AssignExp`, the error caused by `e2->rvaue()` is gagged.
After go back to 1st `AssignExp`, `op_overload` returns `NULL`, but `e2->type` is rewritten to `Terror`.
So second call of `e2->rvalue()` does not cause an actual error, and then semantic incorrectly succeeds.