I noticed that D doesn't support covariant 'out' parameters,
which breaks polymorphism that involves such functions, e.g.:
---
// these classes' foo method returns via return value
class A {A foo(){return new A;}}
class B : A {B foo(){return new B;}}
// these classes' foo method returns via out
On 3/9/2012 4:59 PM, Boscop wrote:
It is crucial for function subtyping, because functions are only contravariant
in their 'in' parameters, but covariant in their 'out' parameters and return
type.
Function subtyping matters not only in classes with methods that have 'out'
parameters but also