-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Extension method call fails because of wrong implicit resolution #12713
Comments
As far as I can see both
And that's as expected. Overloading resolution does not take subsequent givens into account. |
Thank you for your comment @odersky
May I kindly ask you how this code can be overwritten in scala3 then? Thank you |
The difference in behavior is perhaps due to scala/scala#3030 where the explanatory comment is here, for ticket 3346. The Scala 2 spec is clear that overloading picks among implicits, but under the current regime, it eliminates some implicit views by testing applications. The logging looks like:
Sample counter-example which doesn't compile under Scala 3:
Some of those tests are enabled in the dotty repo:
|
Thank you @som-snytt for explanations.. Finally I managed to rewrite it with Conversions:
|
Compiler version
3.0.0, 3.0.1-RC1
Minimized code
Output
Expectation
Expected that
List[Double]
will be extended using[T: Fractional]
extension methodThe text was updated successfully, but these errors were encountered: