With Typelevel Scala you can use
scala> def foo[A: ValueOf]: A = valueOf
foo: [A](implicit evidence$1: ValueOf[A])A
res0: Int = 42
scala> val a = 1
a: Int = 1
res1: a.type = 1
With Lightbend Scala I believe you have to use something like
shapeless.Witness to materialize the value.
Of course I may have misunderstood the question. If you’re in macro land I have no idea.