Skip to content

Commit ddad2eb

Browse files
committed
Another closed issue test
1 parent b0a3ed0 commit ddad2eb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,6 +1585,7 @@ class Typer extends Namer
15851585
// compiles only if the bound variable is Array[Float]. If
15861586
// it is Array[T] we get an implicit not found. To avoid fragility
15871587
// wrt to operand order for `&`, we include the explicit subtype test here.
1588+
// See also #5649.
15881589
then body1.tpe
15891590
else pt1 & body1.tpe
15901591
val sym = ctx.newPatternBoundSymbol(name, symTp, tree.span)

tests/pos/i3208.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Test {
2+
trait E
3+
trait Marker
4+
5+
def test(es: List[E]): List[E] = es.collect { case e: Marker => e }
6+
}

0 commit comments

Comments
 (0)