-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport "Refine implicit priority change warnings" to 3.5.0 (#21171)
Backports #21045 to 3.5.0-RC4
- Loading branch information
Showing
14 changed files
with
82 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- [E172] Type Error: tests/neg/given-triangle.scala:15:18 ------------------------------------------------------------- | ||
15 |@main def Test = f // error | ||
| ^ | ||
|Ambiguous given instances: both given instance given_B and given instance given_C match type A of parameter a of method f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//> using options -Werror | ||
trait Writes[T] | ||
trait Format[T] extends Writes[T] | ||
given [T: List]: Writes[T] = null | ||
given [T]: Format[T] = null | ||
|
||
val _ = summon[Writes[Int]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//> using options -source 3.5 -Werror | ||
trait SameRuntime[A, B] | ||
trait BSONWriter[T] | ||
trait BSONHandler[T] extends BSONWriter[T] | ||
|
||
opaque type Id = String | ||
object Id: | ||
given SameRuntime[Id, String] = ??? | ||
|
||
given BSONHandler[String] = ??? | ||
given [T: BSONHandler]: BSONHandler[List[T]] = ??? | ||
|
||
given opaqueWriter[T, A](using rs: SameRuntime[T, A], writer: BSONWriter[A]): BSONWriter[T] = ??? | ||
|
||
val x = summon[BSONHandler[List[Id]]] // this doesn't emit warning | ||
val y = summon[BSONWriter[List[Id]]] // this did emit warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import language.future | ||
import language.`3.6` | ||
|
||
class A | ||
class B extends A | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Warning: tests/warn/i21036a.scala:7:17 ------------------------------------------------------------------------------ | ||
7 |val y = summon[A] // warn | ||
| ^ | ||
| Given search preference for A between alternatives (b : B) and (a : A) will change | ||
| Current choice : the first alternative | ||
| New choice from Scala 3.6: the second alternative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//> using options -source 3.5 | ||
trait A | ||
trait B extends A | ||
given b: B = ??? | ||
given a: A = ??? | ||
|
||
val y = summon[A] // warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- Warning: tests/warn/i21036b.scala:7:17 ------------------------------------------------------------------------------ | ||
7 |val y = summon[A] // warn | ||
| ^ | ||
| Change in given search preference for A between alternatives (b : B) and (a : A) | ||
| Previous choice : the first alternative | ||
| New choice from Scala 3.6: the second alternative |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//> using options -source 3.6-migration | ||
trait A | ||
trait B extends A | ||
given b: B = ??? | ||
given a: A = ??? | ||
|
||
val y = summon[A] // warn |