-
Notifications
You must be signed in to change notification settings - Fork 21
Type mismatch with a +
operator in an extension method of a newtype
#12960
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
As of 2.13.13, So it seems expected to me that if the code used to require |
By the way, we have done our best to be clear about this in the 2.13.13 release notes as well as the PR description at scala/scala#10573 — if you think further edits would help make the situation clearer, let us know. |
I confirmed that it needs |
Yeah, was about to update that it does work under |
import is not necessary under |
Right, sorry, I deleted my comment. We can't switch to 3-cross (yet) because of the overridden member type inference change - it causes a lot of type mismatches for us (because we omit type signatures practically everywhere) and it doesn't play nice with ZIO's contravariant R parameter (something I encountered here #12707). Unfortunately, fixing it on our side is too "expensive" in terms of changes... Anyway, with the Xsource:3 changes I am finally able to upgrade our codebase to the latest Scala 2.13.13 without (many) additional changes, except this one (and another one having to do with infix operators beginning on a new line). Anyway, thanks for checking, let's keep this issue closed. |
We didn't mention that |
Is there a technical reason or would everything work with explicit types?
With 2.13.13 you could try |
Scala version: 2.13.13 (under
Xsource:3
)The following code, under
Xsource:3
with Scala 2.13.13:Produces the following error:
Problem
The problem started after upgrading to Scala 2.13.13. We use the scala-newtype library, and some of our newtypes that define a
+
operator started to fail with the error above.The code snippet is the simplified "expanded" version of the newtype macro that also exhibits the problem:
In all previous versions, this code compiled fine under Xsource:3.
The text was updated successfully, but these errors were encountered: