bug
bug copied to clipboard
Macros should support untyped parameters
Sometimes it's necessary to pass parameters to macros untyped (e.g. if a parameter is a closure that refers to variables that are introduced by a macro). However, current implementation doesn't support this notion - all params are typechecked before the macro is expanded.
Imported From: https://issues.scala-lang.org/browse/SI-5404?orig=1 Reporter: @xeno-by Affected Versions: 2.10.0
@xeno-by said: Won't be implemented in the near future (i.e. 99% that it won't make it in the first public release of macros).
@milessabin said (edited on Apr 20, 2012 7:49:39 PM UTC): Another use-case for this is a compile-time test that a given expression should not compile. Eg. suppose we have a type class Foo[T] which should not have instances for String, then it would be highly desirable to be able to write a test of the form,
shouldNotCompile(implicitly[Foo[String]])
which typechecks iff implicitly[Foo[String]] does not typecheck.