Skip to content

Commit 0a148c3

Browse files
committed
Assume supertraits in stdlib
The idea is that some traits the 2.13 standard library should get annotated with @superTrait. I added the annotations to our version in the community build. Until that is done, we assume that the annotated traits are super traits by adding them to the assumedSuperTraits set.
1 parent 88636e1 commit 0a148c3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

+11-1
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,17 @@ class Definitions {
13091309
(sym eq Object_eq) || (sym eq Object_ne)
13101310

13111311
@tu lazy val assumedSuperTraits =
1312-
Set(ComparableClass, ProductClass, SerializableClass)
1312+
Set(ComparableClass, ProductClass, SerializableClass,
1313+
ctx.requiredClass("scala.collection.SortedOps"),
1314+
ctx.requiredClass("scala.collection.StrictOptimizedSortedSetOps"),
1315+
ctx.requiredClass("scala.collection.generic.DefaultSerializable"),
1316+
ctx.requiredClass("scala.collection.generic.IsIterable"),
1317+
ctx.requiredClass("scala.collection.generic.IsIterableOnce"),
1318+
ctx.requiredClass("scala.collection.generic.IsMap"),
1319+
ctx.requiredClass("scala.collection.generic.IsSeq"),
1320+
ctx.requiredClass("scala.collection.generic.Subtractable"),
1321+
ctx.requiredClass("scala.collection.immutable.StrictOptimizedSeqOps")
1322+
)
13131323

13141324
// ----- primitive value class machinery ------------------------------------------
13151325

tests/pos/listAndVector.scala

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
var xs = Set(List(0), Vector(0))
2+
var ys: Set[collection.immutable.AbstractSeq[Int]] = xs
3+

0 commit comments

Comments
 (0)