-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport "Drop special treatment of function types in overloading res…
…olution" to LTS (#20914) Backports #19654 to the LTS branch. PR submitted by the release tooling. [skip ci]
- Loading branch information
Showing
3 changed files
with
40 additions
and
28 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,17 @@ | ||
type DiagnosticConsturctor = (Int) => DiagnosticSet | ||
|
||
final class Diagnostic | ||
|
||
final class DiagnosticSet(elements: List[Diagnostic] = List()) | ||
|
||
enum Result: | ||
case Success extends Result | ||
case Failure(diagnose: DiagnosticConsturctor) extends Result | ||
def diagnose(n: Int): DiagnosticSet = | ||
this match | ||
case Success => DiagnosticSet() | ||
case Failure(d) => d(n) | ||
|
||
@main def Test(): Unit = | ||
val r : Result = Result.Failure((n) => DiagnosticSet(List(Diagnostic()))) | ||
r.diagnose(1) |
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