Open
Description
Is there a way to get the source code of the lambda function passed to another function?
I get the expected result with basic types
def myBasicFunc(param: Int): String = {
sourcecode.Args().head.head.toString
}
myBasicFunc(4) // Text(4,param)
But when I try to use the same approach with lambda functions I only get the generic function1 value
def myLambdaFunc(param: Int => Int): String = {
sourcecode.Args().head.head.toString
}
myLambdaFunc(x => x*2) // Text(<function1>,param)
Is this the expected behavior? Am I missing something?
Metadata
Metadata
Assignees
Labels
No labels