-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Regression in greenfossil/data-mapping
- match type on method arguments
#20149
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
That's the way it is. Being able to follow the upper bound of a term parameter was unsound, as illustrated by #19746. Plugging soundness holes trumps not regressing. If the result of match type expansion does not need to appear in the actual result type of the method, a solution can be declare a "copy" local val, as follows: trait Mapping[A]
// Works if newMappings is defined as val/def
def Test(newMappings: Mapping[?] *: Tuple) =
+ val newMappings1 = newMappings
val boundFieldValues: Any *: Tuple =
- newMappings.map[[A] =>> Any] {
+ newMappings1.map[[A] =>> Any] {
[X] => (x: X) => x match
case f: Mapping[t] => ???
} This is sound because |
Hi, I tried to compile our library against the release 3.5.0 and I hit the compilation error. I spent a bit of time going back to 3.4.0 to confirmed it is working. I recalled that it did work during an early 3.5.0 nightly build. Thanks for the example code, I have rectified it. It all seems good now. I have a question, isn't newMappings value is allocated in the stack space and that is technically the same as newMapping1? val newMappings1: Mapping[?] *: Tuple = newMappings |
Based on OpenCB failure in
greenfossil/data-mapping
- build logsCompiler version
Last good release: 3.5.0-RC1-bin-20240403-ece87c3-NIGHTLY
First bad release: 3.5.0-RC1-bin-20240404-a7f00e2-NIGHTLY
Bisect points to 0bf43b2
Minimized code
Output
Expectation
Should compile
The text was updated successfully, but these errors were encountered: