-
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.
Harden GADT constraint handling to survive illegal F-bounds (#20325)
This currently fails BestEffortCompilationTests The problem is that i20317a.scala contains illegal cyclic references. The cycles cause many different algorithms in the compiler to loop. We normally reject the program, and that's that. But under best-effort, we crash with Stackoverflows in the loops later. What to do? It's not feasible to avoid the looping behavior at acceptable cost. Can we disable best effort under certain conditions?
- Loading branch information
Showing
4 changed files
with
11 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
type Foo[A] = A | ||
|
||
def foo[A <: Foo[A]]: Unit = () // error // 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type SemigroupStructural[A] = | ||
A & { def combine(a: A): A } | ||
def combineAll[A <: SemigroupStructural[A]]( | ||
i: A, l: List[A] | ||
): A = l.foldLeft(i)(_.combine(_)) // error |