-
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.
Switch mapping of context bounds to using clauses in 3.6 (#21257)
Was future before. We can roll this out now, since we already made it an error in 3.5 to pass a normal argument to a using clause. It would be good to roll this out now since otherwise context bounds would represent an exception to the implicit priority inversion in #19300. See discussion at the end of #19300 for details.
- Loading branch information
Showing
11 changed files
with
64 additions
and
32 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
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
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,13 @@ | ||
//> using options -source 3.5 | ||
trait Eq[A] | ||
trait Order[A] extends Eq[A]: | ||
def toOrdering: Ordering[A] | ||
|
||
def f[Element: Eq: Order] = summon[Eq[Element]].toOrdering // ok | ||
|
||
def Test() = | ||
val eq: Eq[Int] = ??? | ||
val ord: Order[Int] = ??? | ||
f(eq, ord) // error | ||
f(using eq, ord) // ok | ||
|
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 @@ | ||
//> using options -source 3.6 | ||
trait Eq[A] | ||
trait Order[A] extends Eq[A]: | ||
def toOrdering: Ordering[A] | ||
|
||
def Test[Element: Eq: Order] = summon[Eq[Element]].toOrdering // error |
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
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