We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, we're able to get enclosing method args with sourcecode.Args. Also, in some cases we can get enclosing method name:
sourcecode.Args
def printMethodName()(implicit name: Name) = println(name.value) def myMethod() = printMethodName() // prints "myMethod"
But if there is a local val declared, then implicitly[Name] returns the val's name:
implicitly[Name]
def myMethod() = val breakPrinting = printMethodName() // prints "breakPrinting"
It would be convenient to have something like this:
def printMethodName()(implicit method: Method) = println(method.value) def myMethod() = printMethodName() // prints "myMethod" def myMethod() = val breakPrinting = printMethodName() // prints "myMethod"
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, we're able to get enclosing method args with
sourcecode.Args
. Also, in some cases we can get enclosing method name:But if there is a local val declared, then
implicitly[Name]
returns the val's name:It would be convenient to have something like this:
The text was updated successfully, but these errors were encountered: