Created
April 20, 2017 02:27
-
-
Save wheaties/68742cd8e81a24912eaad04ec63b1dd0 to your computer and use it in GitHub Desktop.
Wherein I place something that causes a StackOverflow in Uncurry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mapParams(methSym: Symbol, tree: DefDef) ={ | |
val DefDef(_, _, _, vp :: vps, _, _) = tree | |
val refTree = gen.mkAttributedRef(tree.symbol.owner.thisType, methSym) | |
val forwarderTree = (Apply(refTree, vp map forwardArg) /: vps){ | |
(fn, params) => Apply(fn, params map forwardArg) | |
} | |
deriveDefDef(tree)(_ => localTyper.typedPos(tree.symbol.pos)(forwarderTree)) | |
} | |
def forwardArg(param: Tree): Tree = | |
if(param.symbol.hasFlag(BYNAMEPARAM)){ | |
val ref = gen.mkAttributedRef(param.symbol) | |
localTyper.typedPos(param.pos){ Function(Nil, ref) } | |
} | |
else gen.paramToArg(param.symbol) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment