aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/typer/Applications.scala2
-rw-r--r--tests/neg/i1640.scala4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Applications.scala b/src/dotty/tools/dotc/typer/Applications.scala
index 56595a637..6c398cd72 100644
--- a/src/dotty/tools/dotc/typer/Applications.scala
+++ b/src/dotty/tools/dotc/typer/Applications.scala
@@ -591,7 +591,7 @@ trait Applications extends Compatibility { self: Typer with Dynamic =>
}
fun1.tpe match {
- case ErrorType => tree.withType(ErrorType)
+ case ErrorType => untpd.cpy.Apply(tree)(fun1, tree.args).withType(ErrorType)
case TryDynamicCallType => typedDynamicApply(tree, pt)
case _ =>
tryEither {
diff --git a/tests/neg/i1640.scala b/tests/neg/i1640.scala
new file mode 100644
index 000000000..78351a1d6
--- /dev/null
+++ b/tests/neg/i1640.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ List(1, 2, 3) map (_ match { case x => x + 1 })
+ List((1, 2)) x (_ match { case (x, z) => x + z }) // error
+}