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
I don't think match types were designed to support higher-kinded types. It's unclear how their spec actually behaves in the presence of higher-kinded types, in particular the disjointness criteria. Also, the formalization of match types in Olivier's thesis, which is the ultimate reference for match types, studies them in the context of F<:, which does not have higher-kinded types at all.
I think we should emit an earlier compile error at the level of the definition of those match types, complaining that the scrutinee is not *-kinded (i.e., <: Any).
Yes, I don't think disjointness makes sense for higher-kinded types. HKTs talk about type functions rather than values, and it's usually possible to find greatest lower bounds between any two similarly-kinded types. For example, regardless of A, B, C, D, the types [X <: A] =>> B[X] and [X <: C] =>> D[X] are never disjoint because the type-level function [X <: Any] =>> Nothing can be assigned both types.
Not sure if this is a bug, a wanted limitation or just an overlook.
There are two issues with any-kinded types and match types.
Compiler version
Master branch
Minimized code
Output
Expectation
No error.
The text was updated successfully, but these errors were encountered: