D-Programming-Language/dmd — pull request #640 by donc (2012-01-25 21:34:42+00:00)
Title: 7295 pure + alias this + 7296 regression

7295 Alias This + Pure + pointsTo = rejects-valid
7296 [2.058] Regression: Cannot swap RefCounted

Suppress errors while determining 'alias this' while looking for a template match. If an error occurs, treat it as a failed match. Bug 7296 is a Phobos regression, where a minor change has triggered this bug.

Ideally the matching step would completely ignore purity and safety, only checking them after a match is found -- that would give better error messages. But to do that cleanly would involve some very intrusive changes. Even then I think errors should still be gagged while doing the alias this transformation.