Created
July 5, 2013 09:38
-
-
Save igstan/5933352 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| object vals { | |
| val fn: Int => String = (n) => n.toString | |
| val f = fn _ // works because fn is a method | |
| def method = { | |
| val fn: Int => String = (n) => n.toString | |
| val f = fn _ // doesn't work because fn is not a method | |
| } | |
| } |
Author
Eew, that's subtle... Nice catch, though!
Author
@lukaseder someone else's catch, but I agree.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/17484457/unable-to-understand-placeholder-behavior-in-scala-function-application