summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-05-08 13:44:39 -0700
committerPaul Phillips <paulp@improving.org>2012-05-08 13:44:39 -0700
commit067c2569257f73afee4ae584f6a589980a8e4660 (patch)
treeef79e1736e8366ee394f2255e3e7dfff2ed02f6c /test
parent83d815622e3e76083496cffa9efb1e7c8fc3e5d3 (diff)
parent00a648bc909f794d91570fb962fc7d7fcd055bc5 (diff)
downloadscala-067c2569257f73afee4ae584f6a589980a8e4660.tar.gz
scala-067c2569257f73afee4ae584f6a589980a8e4660.tar.bz2
scala-067c2569257f73afee4ae584f6a589980a8e4660.zip
Merge commit 'refs/pull/515/head'; commit 'refs/pull/516/head' into develop
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t1247.check1
-rw-r--r--test/files/run/t1247.scala11
2 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t1247.check b/test/files/run/t1247.check
new file mode 100644
index 0000000000..ce123032fd
--- /dev/null
+++ b/test/files/run/t1247.check
@@ -0,0 +1 @@
+Is same closure class: true is same closure: true
diff --git a/test/files/run/t1247.scala b/test/files/run/t1247.scala
new file mode 100644
index 0000000000..c709b73bc8
--- /dev/null
+++ b/test/files/run/t1247.scala
@@ -0,0 +1,11 @@
+object Test extends App {
+ val f = () => 5
+ def test(g: => Int) {
+ val gFunc = g _
+ val isSameClosureClass = gFunc.getClass == f.getClass
+ val isSame = gFunc eq f
+ println("Is same closure class: "+isSameClosureClass+" is same closure: "+isSame)
+ }
+
+ test(f())
+}