You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`getOrElse` and `orElse` use self-types in order to support typed upper bounds.[0]
In TypeScript 2.4, generic functions were checked more strictly[1].
This causes the implicit downward type cast to fail, so we explicitly invoke the cast in the method
body. This workaround is backwards-compatible with TypeScript 2.3.
Bounded polymorphism has been implemented[1], but true F-bounded polymorphism hasn't been.
This means a type like `interface` Option<A, B = Option<A, B>> is invalid.
Alternatively, we can solve this with a lower type bound, but these don't work against concrete
classes[2].
---
We should also upgrade monapt's TypeScript dependency to 2.4, but there are unrelated errors
compiling the tests.
[0] microsoft/TypeScript#13337
[1] https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript
[2] microsoft/TypeScript#14520
0 commit comments