Currently the compiler does magic to generate Manifests on demand:
def foo[T](implicit Manifest[T]) = ...
foo[FooClass]<<Compiler generates a Manifest for FooClass in the foo invocation point>>
Could this compiler task, be replaced by a macro in a future version of Scala?
object Predef{
implicit def manifest[T]: Manifest[T] = macro manifestImpl
def manifestImpl[T](c: Context): Expr[Manifest[T]] = {
// generate a Manifest for T
...
}
}
Regards.
- Andrés