aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-02-21 09:28:22 +0100
committerMartin Odersky <odersky@gmail.com>2017-02-21 09:28:30 +0100
commit5f9e569926728e7f591a26729efa7700387aeb22 (patch)
tree435f8bc107e8def412ce00aef5fbc4d633ac1f53 /tests/neg
parentf467be62da8978e506f58b702b84e74ef7ce09de (diff)
downloaddotty-5f9e569926728e7f591a26729efa7700387aeb22.tar.gz
dotty-5f9e569926728e7f591a26729efa7700387aeb22.tar.bz2
dotty-5f9e569926728e7f591a26729efa7700387aeb22.zip
Don't inline when errors are detected
Inlining is only well-defined if the body to inline does not have any errors. We therefore check for errors before we perform any transformation of trees related to inlining. The error check is global, i.e. we stop on any error not just on errors in the code to be inlined. This is a safe approximation, of course.
Diffstat (limited to 'tests/neg')
-rw-r--r--tests/neg/i2006.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/neg/i2006.scala b/tests/neg/i2006.scala
new file mode 100644
index 000000000..f1b48b011
--- /dev/null
+++ b/tests/neg/i2006.scala
@@ -0,0 +1,10 @@
+object Test {
+
+ inline def foo(f: ImplicitFunction1[Int, Int]): AnyRef = f // error
+ inline def bar(f: ImplicitFunction1[Int, Int]) = f // error
+
+ def main(args: Array[String]) = {
+ foo(implicit thisTransaction => 43)
+ bar(implicit thisTransaction => 44)
+ }
+}