Skip to content

Commit 6fd207f

Browse files
committed
Back off failing refineUsingParent
Turns out to be too strict.
1 parent 0c26ce1 commit 6fd207f

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,10 +917,8 @@ object TypeOps:
917917
}
918918

919919
def instantiate(): Type = {
920-
var failedMixin = false
921920
for tp <- mixins.reverseIterator do
922-
failedMixin ||= !(protoTp1 <:< tp)
923-
if failedMixin then return NoType
921+
protoTp1 <:< tp
924922
maximizeType(protoTp1, NoSpan)
925923
wildApprox(protoTp1)
926924
}

tests/pos/i19031.ci-reg1.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ class Test:
1010
def t1(foo: Foo[Int]): Unit = foo match
1111
case _: Mark[t] =>
1212
case _ =>
13+
14+
def t2[F <: Foo[Int]](foo: F): Unit = foo match
15+
case _: Mark[t] =>
16+
case _ =>

tests/pos/i19031.ci-reg2.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//> using options -Werror
2+
13
trait Outer:
24
sealed trait Foo
35
case class Bar1() extends Foo

0 commit comments

Comments
 (0)