[dmd-internals] Three patches for recent regressions

Jason House jason.james.house at gmail.com
Fri Sep 3 13:01:15 PDT 2010


On Sep 3, 2010, at 3:24 PM, Don Clugston <dclugston at googlemail.com> wrote:

> On 3 September 2010 21:04, Jason House <jason.james.house at gmail.com> wrote:
>> Is this functionality safe? It looks like there's some kind of type variance going on. I'm not sure when covariance and contravariance should be allowed with D templates.
> 
> Where do you see covariance?
> 
> This is a change ONLY to type deduction. If you explicitly specify the
> types, it already works in D1, and in D2 before the regression in
> 2.037.
> I'm not sure what you mean by safe, but in cases where there is
> ambiguity, it won't compile (that was most of the difficulty,
> actually). And it can only match classes/interfaces from the
> inheritance hierarchy. Can you come up with a scenario where it would
> be a problem?

My mistake. That's some awful code. Do I understand it right that if the indirection through C2 is removed that this would become a compile error?


More information about the dmd-internals mailing list