Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros should support untyped parameters #5404

Open
scabug opened this issue Jan 24, 2012 · 3 comments
Open

Macros should support untyped parameters #5404

scabug opened this issue Jan 24, 2012 · 3 comments

Comments

@scabug
Copy link

scabug commented Jan 24, 2012

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.

@scabug
Copy link
Author

scabug commented Jan 24, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5404?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.0

@scabug
Copy link
Author

scabug commented Feb 17, 2012

@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).

@scabug
Copy link
Author

scabug commented Apr 20, 2012

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants