-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Regression: "a match type could not be fully reduced" when flattening a list of tuples #22022
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
Given the bisect commit, I suspect that the new error is legitimate. It fixed an unsoundness issue (#19746), so it may very well prevent compilation of code that worked more-or-less by chance before. |
Not sure if I get this right. Is my usage of The signature of inline def toList: List[Union[this.type]] In its current state |
@Gedochao thanks for the explanation. So I guess this is not exactly a regression. The error is valid because in the declared return type, For example, changing extension [T <: Tuple](t: T)
inline def toList: List[Tuple.Union[T]] = t.productIterator.toList.asInstanceOf[List[Tuple.Union[T]]] would solve the issue (see https://scastie.scala-lang.org/42ADHhqzSEaaAmirzwxqyg) I'm not sure if this can be done in a binary compatible way. |
@hegetim This seems out of scope here, potentially separate issue material.
Alright, so it seems this behaviour is as expected. |
Compiler version
Affected: 3.5.0 and newer (tested on Scastie up to 3.6.1)
Latest working version: 3.4.3
Minimized code
https://scastie.scala-lang.org/ZXMSKeMdT9SdHzvHdxVaQw
Output
Does not compile on 3.5.0 and newer:
Expectation
Should compile (as it does on 3.4.3) and give a flat list of
MyNum
s.The text was updated successfully, but these errors were encountered: