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: interface for communicating with type inference #6755

Closed
scabug opened this issue Dec 2, 2012 · 3 comments
Closed

Macros: interface for communicating with type inference #6755

scabug opened this issue Dec 2, 2012 · 3 comments

Comments

@scabug
Copy link

scabug commented Dec 2, 2012

Currently macros don't expand unless all the type arguments are inferred. This means that type inference uses the return types of macro defs rather than actual types of expansions.

This is a sane design decision (otherwise typetag generation wouldn't work), but it's inconsistent with how macro return types work when type inference isn't involved: http://stackoverflow.com/questions/13669974/static-return-type-of-scala-macros.

To fix the inconsistency we should expand macros at will, giving them a possibility to control their pre-inference shape and a post-inference hook to transform early expansions after type arguments are inferred.

@scabug
Copy link
Author

scabug commented Dec 2, 2012

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

@scabug
Copy link
Author

scabug commented Jan 8, 2013

@xeno-by said (edited on Jan 31, 2013 8:13:39 PM UTC):
See some progress here: https://github.com/scalamacros/kepler/tree/topic/implicit-macros. upd. Moved to http://docs.scala-lang.org/overviews/macros/inference.html.

@scabug
Copy link
Author

scabug commented May 5, 2013

@xeno-by said:
Looks like this is no longer necessary: scala/scala#2494

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

2 participants