On Wednesday, 14 April 2021 at 14:06:18 UTC, FeepingCreature wrote:
On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote:
[..]
Covariance is related ...
[..]

The opposite (contravariance) happens ...
[..]


Nice answer but, just to be clear - D only supports covariance on return types at the moment, and doesn't support contravariance on parameters, right?

I remember contravariance being periodically requested in the past but, AFAICR, it has not been implemented, right? A quick search through the forums didn't turn anything up either... and this does not compile:

```
class A {}
class B : A {}

class Y {
        public void bar (B b) {}
}
class X : Y {
        public override void bar (A a){}
}
```

Reply via email to