summaryrefslogtreecommitdiff
path: root/test/files/neg/sammy_error.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2016-03-21 22:56:08 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2016-03-26 22:55:00 -0700
commit391e2843f420bb4686b974b18ac361c9bb49465c (patch)
tree580deff7251bd37f57fc4b432c6c772f55ff98f0 /test/files/neg/sammy_error.scala
parentb0b0abab89f0c40ba3c45b4a1f7bada31040d55a (diff)
downloadscala-391e2843f420bb4686b974b18ac361c9bb49465c.tar.gz
scala-391e2843f420bb4686b974b18ac361c9bb49465c.tar.bz2
scala-391e2843f420bb4686b974b18ac361c9bb49465c.zip
Don't adapt erroneous tree to SAM type.
Do not report second error. Go straight to the exit. Based on review by Jason.
Diffstat (limited to 'test/files/neg/sammy_error.scala')
-rw-r--r--test/files/neg/sammy_error.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/neg/sammy_error.scala b/test/files/neg/sammy_error.scala
new file mode 100644
index 0000000000..dbddebf325
--- /dev/null
+++ b/test/files/neg/sammy_error.scala
@@ -0,0 +1,7 @@
+trait F1[A, B] { def apply(a: A): B }
+
+class Test {
+ def foo[A](f1: F1[A, A]) = f1
+
+ foo(x => x) // should result in only one error (the second one stemmed from adapting to SAM when the tree was erroneous)
+}