Skip to content

Commit 3d073cd

Browse files
committed
add more comments to code
1 parent f1b9a05 commit 3d073cd

File tree

1 file changed

+5
-3
lines changed
  • compiler/src/dotty/tools/dotc/transform/patmat

1 file changed

+5
-3
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,15 +582,17 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
582582
// replace type parameter references with fresh type vars or bounds
583583
val typeParamMap = new TypeMap {
584584
def apply(t: Type): Type = t match {
585+
585586
case tp: TypeRef if tp.underlying.isInstanceOf[TypeBounds] =>
587+
// See tests/patmat/gadt.scala tests/patmat/exhausting.scala
586588
val bound =
587-
if (variance == 0) tp.underlying.bounds
589+
if (variance == 0) tp.underlying.bounds // non-variant case is not well-founded
588590
else if (variance == 1) TypeBounds.upper(tp)
589591
else TypeBounds.lower(tp)
590592
newTypeVar(bound)
591593
case tp: RefinedType if tp.refinedInfo.isInstanceOf[TypeBounds] =>
592-
// Ideally, we would expect type inference can do the job
593-
// tests/patmat/t9657.scala
594+
// Ideally, we would expect type inference to do the job
595+
// Check tests/patmat/t9657.scala
594596
expose(tp)
595597
case _ =>
596598
mapOver(t)

0 commit comments

Comments
 (0)