-
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.
Merge pull request #15636 from griggt/fix-13668
Merge nested polytypes in more cases in resolveOverloaded
- Loading branch information
Showing
3 changed files
with
22 additions
and
2 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,5 @@ | ||
extension [T1](x: T1)(using Numeric[T1]) | ||
def combine[T2](y: T2)(using Numeric[T2]) = ??? | ||
def combine(y: String) = ??? | ||
|
||
val res = 100.combine(200) |
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,15 @@ | ||
class MyType() | ||
trait Candidate[R] | ||
given Candidate[MyType] with {} | ||
class Fuzzy[W]() | ||
class Fuzzy1() | ||
class Bear() | ||
|
||
extension [L](lhs: L)(using Candidate[L]) | ||
def +[RW](rhs: Fuzzy[RW]): Unit = {} | ||
def +(rhs: Bear): Unit = {} | ||
def -(rhs: Fuzzy1): Unit = {} | ||
def -(rhs: Bear): Unit = {} | ||
|
||
val works = MyType() - Fuzzy1() | ||
val fails = MyType() + Fuzzy[1]() |