Skip to content

Unactionable warning: "Given search preference for ... will change." #22153

Closed
@eed3si9n

Description

@eed3si9n

Compiler version

3.6.4-RC1-bin-20241204-a67dbb0-NIGHTLY

Minimized code

You can grab sbt/sbt develop branch fdc03b782a40ce1f04bcefcd7eb3dc45fa7927d0.

I'm guessing that the minimized repro is basically https://github.com/scala/scala3/blob/c61897d7e78bfea283f5a2e37215c3b528e7684f/tests/warn/i21036a.scala

trait A
trait B extends A
given b: B = ???
given a: A = ???

val y = summon[A] // warn

Output

Currently the compile fails because I have -Xfatal-warnings and there's a warning about a given search:

[warn] -- Warning: /sbt/protocol/src/main/contraband-scala/sbt/protocol/codec/SettingQuerySuccessFormats.scala:14:91
[warn] 14 |      val value = unbuilder.readField[sjsonnew.shaded.scalajson.ast.unsafe.JValue]("value")
[warn]    |                                                                                           ^
[warn]    |Given search preference for sjsonnew.JsonReader[sjsonnew.shaded.scalajson.ast.unsafe.JValue] between alternatives
[warn]    |  (SettingQuerySuccessFormats.this.JValueFormat :
[warn]    |  sjsonnew.JsonFormat[sjsonnew.shaded.scalajson.ast.unsafe.JValue])
[warn]    |and
[warn]    |  (SettingQuerySuccessFormats.this.JValueJsonReader :
[warn]    |  sjsonnew.JsonReader[sjsonnew.shaded.scalajson.ast.unsafe.JValue])
[warn]    |will change.
[warn]    |Current choice           : the first alternative
[warn]    |New choice from Scala 3.7: the second alternative

Expectation

I expect all warnings to be actionable. This type of "FYI" message should go into the release note or -Xmigration 3.5.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions