aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/transform/SuperAccessors.scala5
-rw-r--r--tests/pos/t4062.scala7
2 files changed, 7 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/transform/SuperAccessors.scala b/src/dotty/tools/dotc/transform/SuperAccessors.scala
index 213a2369d..cfd78a91d 100644
--- a/src/dotty/tools/dotc/transform/SuperAccessors.scala
+++ b/src/dotty/tools/dotc/transform/SuperAccessors.scala
@@ -155,11 +155,6 @@ class SuperAccessors extends MacroTransform
else tree
try tree match {
- // Don't transform patterns or strange trees will reach the matcher (ticket #4062)
- // TODO Query `ctx.mode is Pattern` instead.
- case CaseDef(pat, guard, body) =>
- cpy.CaseDef(tree)(pat, transform(guard), transform(body))
-
case impl: Template =>
def transformTemplate = {
diff --git a/tests/pos/t4062.scala b/tests/pos/t4062.scala
new file mode 100644
index 000000000..63e05b739
--- /dev/null
+++ b/tests/pos/t4062.scala
@@ -0,0 +1,7 @@
+class A(val f : String)
+
+class B(a : Option[String], f : String) extends A(f) {
+ a match {
+ case Some(`f`) => print(f)
+ }
+}