-
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.
fix: Only implement a deferred given in a class if its parent won't i…
…mplement it (#21206) It should be possible to extend a class that inherits a deferred given, so a generated given implementation should not be final. closes #21189
- Loading branch information
Showing
3 changed files
with
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//> using options -source:future -language:experimental.modularity | ||
|
||
class MySortedSet[T : Ord] extends SortedSet[T] | ||
|
||
trait Ord[T] | ||
|
||
trait Sorted[T] extends ParentOfSorted[T] | ||
|
||
trait ParentOfSorted[T]: | ||
given Ord[T] as ord = compiletime.deferred | ||
|
||
class SortedSet[T : Ord] extends Sorted[T] |
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,10 @@ | ||
//> using options -source:future -language:experimental.modularity | ||
|
||
class MySortedSet[T : Ord] extends SortedSet[T] | ||
|
||
trait Ord[T] | ||
|
||
trait Sorted[T]: | ||
given Ord[T] as ord = compiletime.deferred | ||
|
||
class SortedSet[T : Ord] extends Sorted[T] |