summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2010-08-09 13:37:07 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2010-08-09 13:37:07 +0000
commite5efbddf19bfeac109997d0186dc143bbc7e63c3 (patch)
tree19a7d94ab03504c7cd7966db4f40f0fc73a35c22
parent5a50d83a33f1c3b8a7ad3e71ad0beb1e7533489b (diff)
downloadscala-e5efbddf19bfeac109997d0186dc143bbc7e63c3.tar.gz
scala-e5efbddf19bfeac109997d0186dc143bbc7e63c3.tar.bz2
scala-e5efbddf19bfeac109997d0186dc143bbc7e63c3.zip
close #7226.
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeInfo.scala2
-rw-r--r--test/files/run/t3726.check2
-rw-r--r--test/files/run/t3726.scala8
3 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
index 46ddf7b24b..546e62f85a 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala
@@ -85,8 +85,6 @@ abstract class TreeInfo {
tree.symbol.isStable && isPureExpr(qual)
case TypeApply(fn, _) =>
isPureExpr(fn)
- case Apply(fn, List()) =>
- isPureExpr(fn)
case Typed(expr, _) =>
isPureExpr(expr)
case Block(stats, expr) =>
diff --git a/test/files/run/t3726.check b/test/files/run/t3726.check
new file mode 100644
index 0000000000..7a5775bf34
--- /dev/null
+++ b/test/files/run/t3726.check
@@ -0,0 +1,2 @@
+hi there
+5 \ No newline at end of file
diff --git a/test/files/run/t3726.scala b/test/files/run/t3726.scala
new file mode 100644
index 0000000000..5ceed5416e
--- /dev/null
+++ b/test/files/run/t3726.scala
@@ -0,0 +1,8 @@
+object Test extends Application {
+ def test(f: () => Int) = {
+ val x = f()
+ 5
+ }
+
+ println(test(() => { println("hi there"); 0 }))
+}