Skip to content

Conversation

nicolasstucki
Copy link
Contributor

Getting the info from the mirror in a macro is a bit tricky and verbose. The methods in this portotype intend to make this process trivial.

private def myMacroExpr[T: Type](mirror: Expr[Mirror.Of[T]])(using Quotes): Expr[Any] = import MirroredExpr.* // TODO where we could define this? val mirroredLabel: Option[String] = mirror.mirroredLabel val mirroredElemLabels: Option[List[String]] = mirror.mirroredElemLabels val mirroredMonoType: Option[Type[?]] = mirror.mirroredMonoType val mirroredType: Option[Type[?]] = mirror.mirroredType val mirroredElemTypes: Option[List[Type[?]]] = mirror.mirroredElemTypes ...

[skip community_build]
[skip docs]
[skip mima]

Getting the info from the mirror in a macro is a bit tricky and verbose. The methods in this portotype intend to make this process trivial.
@nicolasstucki nicolasstucki marked this pull request as ready for review June 27, 2023 11:50
@nicolasstucki nicolasstucki requested a review from bishabosha June 27, 2023 11:50
@nicolasstucki nicolasstucki enabled auto-merge June 27, 2023 11:51
@nicolasstucki nicolasstucki merged commit 6acaf95 into scala:main Jun 27, 2023
@nicolasstucki nicolasstucki deleted the mirror-expr-library-portotype branch June 27, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants