File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
main/define/src/mill/define Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 11package mill .define
22
3- // import sourcecode.Compat.Context
4- // import language.experimental.macros
3+ import scala .quoted .*
54
65case class Caller (value : Any )
76object Caller {
87 def apply ()(implicit c : Caller ) = c.value
9- implicit def generate : Caller = ??? // macro impl
10- // def impl(c: Context): c.Tree = {
11- // import c.universe._
12- // q"new _root_.mill.define.Caller(this)"
13- // }
8+
9+ /* basically a poison-pill to check that the Module defined version is enough */
10+ inline given generate : Caller = defaultCaller
11+
12+ @ annotation.compileTimeOnly(" No enclosing scope, this is a bug" )
13+ def defaultCaller : Caller = Caller (null )
1414}
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ trait Module extends Module.BaseClass {
4242 implicit def millModuleSegments : Segments = {
4343 millOuterCtx.segments ++ Seq (millOuterCtx.segment)
4444 }
45+ final given millModuleCaller : Caller = Caller (this )
4546
4647 override def toString = millModuleSegments.render
4748}
You can’t perform that action at this time.
0 commit comments