summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/origins.check6
-rw-r--r--test/files/run/origins.scala21
2 files changed, 27 insertions, 0 deletions
diff --git a/test/files/run/origins.check b/test/files/run/origins.check
new file mode 100644
index 0000000000..c088ea05c2
--- /dev/null
+++ b/test/files/run/origins.check
@@ -0,0 +1,6 @@
+
+>> Origins goxbox.Socks.boop logged 65 calls from 3 distinguished sources.
+
+ 50 Test$$anonfun$f3$1.apply$mcII$sp(origins.scala:16)
+ 10 Test$$anonfun$f2$1.apply$mcII$sp(origins.scala:15)
+ 5 Test$$anonfun$f1$1.apply$mcII$sp(origins.scala:14)
diff --git a/test/files/run/origins.scala b/test/files/run/origins.scala
new file mode 100644
index 0000000000..4c98e7a66c
--- /dev/null
+++ b/test/files/run/origins.scala
@@ -0,0 +1,21 @@
+import scala.tools.nsc.util.Origins
+
+package goxbox {
+ object Socks {
+ val origins = Origins[Socks.type]("boop")
+
+ def boop(x: Int): Int = origins { 5 }
+ }
+}
+
+object Test {
+ import goxbox.Socks.boop
+
+ def f1() = 1 to 5 map boop
+ def f2() = 1 to 10 map boop
+ def f3() = 1 to 50 map boop
+
+ def main(args: Array[String]): Unit = {
+ f1() ; f2() ; f3()
+ }
+}