You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.5.0-RC3 with -source:future -language:experimental.modularity
Minimized code
traitOrd[T]
traitSorted[T]:givenOrd[T] as ord = compiletime.deferred
classSortedSet[T:Ord] extendsSorted[T]
classSortedSet2[T:Ord] extendsSortedSet[T]
Output
^
error overriding giveninstance ord in classSortedSet of typeOrd[T];
giveninstance ord of typeOrd[T] cannot overridefinal member giveninstance ord in classSortedSet
rjolly
changed the title
Can't extend a class with a context bound parameter under experimental.modularity
Under experimental.modularity, cannot extend a class inheriting a deferred given
Jul 13, 2024
I managed to minimize it into a single file, but the order of declarations is important. Or at least it's important for MySortedSet to be declared before SortedSet.
//>usingscala3.nightly//>usingoptions-source:future-language:experimental.modularityclassMySortedSet[T:Ord] extendsSortedSet[T]
traitOrd[T]
traitSorted[T]:givenOrd[T] as ord = compiletime.deferred
openclassSortedSet[T:Ord] extendsSorted[T]
…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
Compiler version
3.5.0-RC3 with -source:future -language:experimental.modularity
Minimized code
Output
Workaround
The text was updated successfully, but these errors were encountered: