File tree Expand file tree Collapse file tree 3 files changed +23
-10
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -144,15 +144,15 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
144
144
case info2 : TypeAlias => isSubType(tp1, info2.alias)
145
145
case _ => info1 match {
146
146
case info1 : TypeAlias => isSubType(info1.alias, tp2)
147
- case NoType => secondTry(tp1, tp2)
148
- case _ => thirdTryNamed(tp1, tp2)
147
+ case _ => false
149
148
}
150
149
}
151
150
def compareNamed = {
152
151
implicit val ctx : Context = this .ctx // Dotty deviation: implicits need explicit type
153
152
tp1 match {
154
153
case tp1 : NamedType =>
155
154
val sym1 = tp1.symbol
155
+ compareAlias(tp1.info) ||
156
156
(if ((sym1 ne NoSymbol ) && (sym1 eq tp2.symbol))
157
157
ctx.erasedTypes || sym1.isStaticOwner || isSubType(tp1.prefix, tp2.prefix)
158
158
else
@@ -164,10 +164,11 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling {
164
164
) ||
165
165
compareHK(tp1, tp2, inOrder = true ) ||
166
166
compareHK(tp2, tp1, inOrder = false ) ||
167
- compareAlias (tp1.info )
167
+ thirdTryNamed (tp1, tp2 )
168
168
case _ =>
169
169
compareHK(tp2, tp1, inOrder = false ) ||
170
- compareAlias(NoType )
170
+ compareAlias(NoType ) ||
171
+ secondTry(tp1, tp2)
171
172
}
172
173
}
173
174
compareNamed
Original file line number Diff line number Diff line change 263
263
./scala-scala/src/library/scala/collection/generic/GenericSeqCompanion.scala
264
264
./scala-scala/src/library/scala/collection/generic/GenericSetTemplate.scala
265
265
266
- # deep subtype
267
- #./scala-scala/src/library/scala/collection/generic/GenericTraversableTemplate.scala
266
+ ./scala-scala/src/library/scala/collection/generic/GenericTraversableTemplate.scala
268
267
269
268
./scala-scala/src/library/scala/collection/generic/HasNewBuilder.scala
270
269
./scala-scala/src/library/scala/collection/generic/HasNewCombiner.scala
271
270
272
- # https://github.com/lampepfl/dotty/issues/943
273
- # [error] Test dotc.tests.compileStdLib failed: java.lang.Error: deep subtype, took 6.462 sec
274
- #./scala-scala/src/library/scala/collection/generic/ImmutableMapFactory.scala
275
- #./scala-scala/src/library/scala/collection/generic/ImmutableSetFactory.scala
271
+ ./scala-scala/src/library/scala/collection/generic/ImmutableMapFactory.scala
272
+ ./scala-scala/src/library/scala/collection/generic/ImmutableSetFactory.scala
276
273
277
274
./scala-scala/src/library/scala/collection/generic/ImmutableSortedMapFactory.scala
278
275
./scala-scala/src/library/scala/collection/generic/ImmutableSortedSetFactory.scala
Original file line number Diff line number Diff line change
1
+ // Minimized from scala.collection.generic.GenTraversableFactory plus dependencies
2
+ import scala .annotation .unchecked .uncheckedVariance
3
+
4
+ trait GT [A ] extends GTT [A , GT ]
5
+
6
+ trait HNB [B ]
7
+ trait GTT [+ C , DD [X ] <: GT [X ]] extends HNB [DD [C ] @ uncheckedVariance] // Can be any annotation and still crash
8
+
9
+ class GTF [EE [X ] <: GT [X ] with GTT [X , EE ]]
10
+ {
11
+ def foo [F ]: EE [F ] = ???
12
+ def bar [G ](f : G ): EE [G ] = ???
13
+
14
+ def tabulate : EE [EE [Int ]] = bar(foo)
15
+ }
You can’t perform that action at this time.
0 commit comments