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 67e2b6a commit 3cc4837Copy full SHA for 3cc4837
compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -116,7 +116,7 @@ object PatternMatcher {
116
/** Widen type as far as necessary so that it does not refer to a pattern-
117
* generated variable.
118
*/
119
- private def sanitize(tp: Type): Type = tp.widenExpr match {
+ private def sanitize(tp: Type): Type = tp.widenTermRefExpr match {
120
case tp: TermRef if refersToInternal(false, tp) => sanitize(tp.underlying)
121
case tp => tp
122
}
tests/pos/i4999.scala
@@ -0,0 +1,9 @@
1
+trait Foo
2
+final class Bar extends Foo
3
+
4
+class Test {
5
+ def test(xs: => Foo) = xs match {
6
+ case xs: Bar => 1
7
+ case _ => 2
8
+ }
9
+}
0 commit comments