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
Mirrors give us a lot "for free", but I think we could do just as well without them (that is, give the same user experience & performance), while additionally supporting multi-level hierarchies
The text was updated successfully, but these errors were encountered:
adamw
changed the title
Consider not using Mirrors for derivation, so that multi-level hierarchies can be supportd
Consider not using Mirrors for derivation, so that multi-level hierarchies can be suppored
Jun 10, 2021
I agree. I've been thinking about rewriting most of the derivation logic to macros for a while.
But when it comes to ditching Mirrors altogether, there is IMHO a problem with accessing subtypes of a trait. (And that is mostly why I haven't mentioned it before) But there is also a chance that I missed something.
There is also this docs page. It still uses Mirrors, but on a bit lower level. Maybe it would work better?
But when it comes to ditching Mirrors altogether, there is IMHO a problem with accessing subtypes of a trait. (And that is mostly why I haven't mentioned it before) But there is also a chance that I missed something.
Of a non-sealed trait? I suppose for sealed traits / enums we can use Symbol.children?
If not, maybe indeed summoning mirrors and using this information level by level would work.
Mirrors give us a lot "for free", but I think we could do just as well without them (that is, give the same user experience & performance), while additionally supporting multi-level hierarchies
The text was updated successfully, but these errors were encountered: