-
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
Was future before.
- Loading branch information
Showing
5 changed files
with
40 additions
and
21 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,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