Skip to content

Commit 8a1fd0a

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 c53efb6 commit 8a1fd0a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,17 @@ class Definitions {
13061306
(sym eq Object_eq) || (sym eq Object_ne)
13071307

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

13111321
// ----- primitive value class machinery ------------------------------------------
13121322

tests/pos/listAndVector.scala

Lines changed: 3 additions & 0 deletions
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)