-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Tuple.Filter doesn't work if the result tuple type is of length more than 1 #10896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It looks like the example can be fixed by adding a type bound on the match type type IsString[x] <: Boolean = x match {
case String => true
case _ => false
} Now the question is: is the fact that the compiler cannot inter the bounds actually a bug or is this an inherent limitation of match types? One more suspicious thing is that if the bounds are not specified then val x = summon[Filter[(Char, Int), IsString] =:= EmptyTuple] does work even though type Filtered = Filter[(Char, Int), IsString] itself does not compile |
@OlivierBlanvillain is the match type |
Does that mean that the current behavior is correct (i.e. we need the extra |
The noncompiling snippet was taken from the documentation of |
Indeed, we should update the docs |
Documentation seems to have been fixed by 7af9a40. |
Seems legit to me. By the current typing rules, match types are not subtypes of the union of their cases. |
Minimized code
Output
Expectation
This should compile and an evidence for type equality should be correctly synthesized
The text was updated successfully, but these errors were encountered: