summaryrefslogtreecommitdiff
path: root/main/core/src/define/Caller.scala
diff options
context:
space:
mode:
Diffstat (limited to 'main/core/src/define/Caller.scala')
-rw-r--r--main/core/src/define/Caller.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/main/core/src/define/Caller.scala b/main/core/src/define/Caller.scala
new file mode 100644
index 00000000..6d2d4d1d
--- /dev/null
+++ b/main/core/src/define/Caller.scala
@@ -0,0 +1,13 @@
+package mill.define
+
+import sourcecode.Compat.Context
+import language.experimental.macros
+case class Caller(value: Any)
+object Caller {
+ def apply()(implicit c: Caller) = c.value
+ implicit def generate: Caller = macro impl
+ def impl(c: Context): c.Tree = {
+ import c.universe._
+ q"new _root_.mill.define.Caller(this)"
+ }
+} \ No newline at end of file