scala-dev
scala-dev copied to clipboard
Guide for macro authors SAM/FunctionN targeting Function trees
trafficstars
We should give guidance to folks who are pattern matching on Function nodes in macros or compiler plugins (perhaps via quasiquotes) that they will need to discriminate based on the tree type if they only want to work with bona fide functions.
retargeted for 2.12.x
Can you outline a scenario where this distinction would make a difference?
Not really, which is why I never wrote anything up around this :-) Be aware of the SAMFunction (if memory serves) tree attachment that will mean this tree will not get expanded to an anonymous subclass, but rather an invokedynamic of LMF.