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 4dfb838 commit fca6688Copy full SHA for fca6688
compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -521,10 +521,11 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
521
inContext(ctx.fresh.setNewTyperState()) {
522
val tvars = pt.paramInfos.map(newTypeVar)
523
val mt = pt.instantiate(tvars).asInstanceOf[MethodType]
524
- // println("mt.paramInfos(0) = " + mt.paramInfos(0))
525
scrutineeTp <:< mt.paramInfos(0)
526
- isFullyDefined(mt, ForceDegree.flipBottom)
527
- // println("mt = " + mt)
+ // force type inference to infer a narrower type: could be singleton
+ // see tests/patmat/i4227.scala
+ mt.paramInfos(0) <:< scrutineeTp
528
+ isFullyDefined(mt, ForceDegree.all)
529
mt
530
}
531
0 commit comments