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 b0a3ed0 commit ddad2ebCopy full SHA for ddad2eb
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -1585,6 +1585,7 @@ class Typer extends Namer
1585
// compiles only if the bound variable is Array[Float]. If
1586
// it is Array[T] we get an implicit not found. To avoid fragility
1587
// wrt to operand order for `&`, we include the explicit subtype test here.
1588
+ // See also #5649.
1589
then body1.tpe
1590
else pt1 & body1.tpe
1591
val sym = ctx.newPatternBoundSymbol(name, symTp, tree.span)
tests/pos/i3208.scala
@@ -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