Despite technically val fulfils TypeA & TypeB intersection.
In non-strict mode, works as intended.
I understand why this happens and straight out of the box I don't know if there any good solution for it. However, that's definitely not how intersections usually work in typed systems.
Maybe intersections should be treated as non-strict even in strict mode?
In strict mode, intersections of interfaces are always returning errors.
Consider this example:
That example basically unfulfillable. It will always result in an error:
Despite technically
val
fulfilsTypeA & TypeB
intersection.In non-strict mode, works as intended.
I understand why this happens and straight out of the box I don't know if there any good solution for it. However, that's definitely not how intersections usually work in typed systems.
Maybe intersections should be treated as non-strict even in strict mode?