Please sign in to comment.
Provide a way for unapply macro to obtain a list of subpattens
This commit introduces internal attachment that allows unapply macros to be aware of their sub patterns and tweak their expansion depending on that info. At the moment this is not possible due to the way pattern macros are expanded: case MacroPat(inner1, inner2) => ... During type checking this will expand as MacroPat.unapply(<unapply-dummy>) Meaning that macro can’t see inner1 and inner2 in it’s macroApplication. To circumvent this we attach that info as an attachment to the dummy.
- Loading branch information...
Showing with 7 additions and 1 deletion.