Skip to content
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

New implicit resolution warning mentions "This will be an error in Scala 3.5 and later." but is not an error in 3.5.0-RC1 #20415

Closed
smarter opened this issue May 15, 2024 · 1 comment · Fixed by #20441
Assignees
Labels
area:implicits related to implicits area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug

Comments

@smarter
Copy link
Member

smarter commented May 15, 2024

Compiler version

3.5.0-RC1

Minimized code

class Foo:
  given ord: Ordering[Int] = summon[Ordering[Int]]

Output

  |                                                            ^
  |Result of implicit search for Ordering[Int] will change.
  |Current result Foo.this.ord will be no longer eligible
  |  because it is not defined before the search position.
  |Result with new rules: scala.math.Ordering.Int.
  |To opt into the new rules, compile with `-source future` or use
  |the `scala.language.future` language import.
  |
  |To fix the problem without the language import, you could try one of the following:
  |  - use a `given ... with` clause as the enclosing given,
  |  - rearrange definitions so that Foo.this.ord comes earlier,
  |  - use an explicit argument.
  |This will be an error in Scala 3.5 and later.

Expectation

This should actually be an error. Also, ideally I'd really like to enable the new behavior in my codebase, but -source future breaks too many things, can we add it to -source 3.6 instead?

@smarter smarter added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:reporting Error reporting including formatting, implicit suggestions, etc area:implicits related to implicits and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels May 15, 2024
@smarter smarter added this to the 3.5.0-RC2 milestone May 15, 2024
@odersky
Copy link
Contributor

odersky commented May 19, 2024

It seems the default source version is still 3.4. Somehow we missed the step to bump it.

odersky added a commit to dotty-staging/dotty that referenced this issue May 19, 2024
@hamzaremmal hamzaremmal self-assigned this May 19, 2024
@hamzaremmal hamzaremmal linked a pull request May 20, 2024 that will close this issue
hamzaremmal added a commit that referenced this issue May 27, 2024
Superseeds #20435 
Closes #20415 

[test_scala2_library_tasty]
[test_windows_full]
[test_java8]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:implicits related to implicits area:reporting Error reporting including formatting, implicit suggestions, etc itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants