scala-dev icon indicating copy to clipboard operation
scala-dev copied to clipboard

Guide for macro authors SAM/FunctionN targeting Function trees

Open adriaanm opened this issue 9 years ago • 3 comments
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.

adriaanm avatar Apr 03 '16 15:04 adriaanm

retargeted for 2.12.x

SethTisue avatar Dec 02 '16 01:12 SethTisue

Can you outline a scenario where this distinction would make a difference?

milessabin avatar Dec 02 '16 09:12 milessabin

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.

adriaanm avatar Dec 03 '16 00:12 adriaanm