You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
Very surprised that nobody has raised this before, so figured I'd better.
Currently, macro annotations are not supported in scala 3.
Some of the functionality can be achieved with typeclass derivation and/or Selectable machinery, but it's amazingly awkward, suffers from the limitations of Selectable, and anything that's generated doesn't make it to the class definition.
Something that integrates nicely/reuses with both the existing quoting/splicing and lower level reflect API would be ideal, but it'd be great to be able to generate any code that you can write (as part of compilation, so people are unable to modify the generated code).
I believe we can consider this implemented via scala/scala3#16392 and scala/scala3#16454, so I'll go ahead and close. If there are further ideas please do open a discussion here.
Very surprised that nobody has raised this before, so figured I'd better.
Currently, macro annotations are not supported in scala 3.
Some of the functionality can be achieved with typeclass derivation and/or
Selectable
machinery, but it's amazingly awkward, suffers from the limitations ofSelectable
, and anything that's generated doesn't make it to the class definition.Something that integrates nicely/reuses with both the existing quoting/splicing and lower level reflect API would be ideal, but it'd be great to be able to generate any code that you can write (as part of compilation, so people are unable to modify the generated code).
Related:
Scala 2 macro annotation docs:
https://docs.scala-lang.org/overviews/macros/annotations.html
An old blog post that mentioned it could be done (I just assumed it hadn't been implemented yet)
https://www.scala-lang.org/blog/2018/04/30/in-a-nutshell.html
An example of a 2.x use case:
https://zio.dev/version-1.x/howto/use-zio-macros/
The text was updated successfully, but these errors were encountered: