-
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
Regression for method dispatch in 7mind/izumi
#21307
Comments
Wait, that's not possible. None of these commits touch the compiler itself. It's only related to the presentation compiler module |
Could this just be flaky? |
In af933c4...46ff151 #21226 looks like the best candidate, with #21248 as a fallback. Those commits mentioned don't even seem to be part of the commit range. Is the commit message auto-generated by a script? Because I think there's a bug in the script. |
Btw, this continues to not compile for me locally on main, which is a2c53a1. cc @EugeneFlesselle who's been active on the given prio change changes. |
The issue minimizes to: trait P[X]
given P[Int] with {}
def foo[F]()(implicit p: P[F]): F = ???
def foo[F: P]: () => F = ???
def works = foo()(using summon[P[Int]])
def fails = foo() It is introduced by Switch mapping of context bounds to using clauses in 3.6 #21257.
With the 2nd version, we have the same error both before and after the changes: 11 |def fails = foo()
| ^^^
|Ambiguous overload. The overloaded alternatives of method foo with types
| [F](using x$1: P[F]): () => F
| [F]()(implicit p: P[F]): F
|both match arguments ()
|----------------------------------------------------------------------------
| Explanation (enabled by `-explain`)
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| There are 2 methods that could be referenced as the compiler knows too little
| about the expected type.
| You may specify the expected type e.g. by
| - assigning it to a value with a specified type, or
| - adding a type ascription as in instance.myMethod: String => Int
---------------------------------------------------------------------------- I believe this is an intended change in behavior of #21257. Unless it is causing too many regressions, this should probably be a won't-fix. \cc @WojciechMazur @Gedochao A trivial, but unideal, user-code fix would be to manually make the context bound an def fails = (IO2: IO2[F])(println("hello world!")) // now works |
@EugeneFlesselle agreed. Closing this as |
Compiler version
Last good release: 3.6.0-RC1-bin-20240719-af933c4-NIGHTLY
First bad release: 3.6.0-RC1-bin-20240723-46ff151-NIGHTLY
Bisect scripts failed to build the compiler for some revisions, the first bad commit could be any of:
3b3b8a7
637b1d3
2cfc561
875af44
dec395b
Minimized code
Output
Expectation
Should compile
The text was updated successfully, but these errors were encountered: