-
Notifications
You must be signed in to change notification settings - Fork 1.1k
document migration of macros that require fresh names #12960
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
Comments
All names you give will be automatically made fresh in scope, do you have an example where something breaks because of this expectation? |
Then it's important to clearly state that point in the migration guide. I haven't personally seen anything about (neither in the source quote). |
Technically we do not support the fresh name concept as this is part of syntactic macros that scala 3 does not support (such as in re-typethinking). We only support semantic macros where names are themself semantic (i.e. symbol). These names do not need to be refreshed as conflicts are not possible. In Scala 3 once you created a name for a definition, it is guaranteed to not have conflicts. Internally there are some renaming that happens for local variables to make it possible to distinguish different names. We need a migration example with some code that requires re-typechecking and fresh names. |
This issue was picked for the Issue Spree 18 of July 5th which takes place in a week from now. @EstebanMarin @anatoliykmetyuk will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here. |
This issue was picked for the Issue Spree n° 19 of August 16th which takes place in a week from now. @tgodzik @gagandeepkalra @jackcviers will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here. |
I might not be able to join unfortunately today. 😓 I am curious though what was the result of the previous spree @anatoliykmetyuk ? |
Hello everyone. @tgodzik @anatoliykmetyuk In the previous meetings we had on this, the idea was simple. Is to start a scala 3 seed: https://index.scala-lang.org/regadas/scala-seed and ensure the code of the macros https://docs.scala-lang.org/scala3/guides/macros/ tutorial runs. |
The tutorial doesn't indicate that unlike Scala 2 macro there is no need to do anything special to have fresh term name, so that's different issue. |
Scala 2 Macro freshName has no equivalent in new meta-programming API.
The text was updated successfully, but these errors were encountered: