We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 013149c commit 5bc9fcbCopy full SHA for 5bc9fcb
compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -814,7 +814,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
814
def checkGADT(tp: Type): Boolean = {
815
new TypeAccumulator[Boolean] {
816
override def apply(b: Boolean, tp: Type): Boolean = tp match {
817
- case tref: TypeRef if tref.symbol.is(TypeParam) => true
+ case tref: TypeRef if tref.symbol.is(TypeParam) && variance == 0 => true
818
case tp => b || foldOver(b, tp)
819
}
820
}.apply(false, tp)
0 commit comments