What    |Removed                     |Added
                 CC|                            |

--- Comment #2 from 2012-03-16 03:08:17 PDT ---
(In reply to comment #1)
> It's not clear that there's a bug here. typeof(this).init correctly shouldn't
> compile inside a mixin, because the mixin might add an extra field

It does not add an extra field.

> -- so then init would change.

If I added some random character to a valid d program, then it would likely not
be valid anymore. What does this prove?

> .init is defined only when all possible members of the aggregate have been
> declared.

This is the case in the example. What should be illegal is adding a field that
changes .init based on a static condition that depends on .init. This would be
part of a necessary general overhaul of symbol lookup works in DMD: Forward
declarations and compile-time reflection make it possible to write
contradictory or ambiguous D programs. The compiler should detect such setups
in the least conservative way we can come up with.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to