Using this example:
interface A {
build(): SomeType;
}
interface B extends A{
build(): SomeOtherType;
}
The compiler will thrown an error that SomeOtherType is not assignable to SomeType. However, if I am holding an object of type B and I call build() on that object, I know that I will receive a value of type SomeOtherType.
I've currently used any as an override, but it would nice to be able to override the return type of functions on a parent class or interface.
Using this example:
The compiler will thrown an error that SomeOtherType is not assignable to SomeType. However, if I am holding an object of type B and I call build() on that object, I know that I will receive a value of type SomeOtherType.
I've currently used any as an override, but it would nice to be able to override the return type of functions on a parent class or interface.