Skip to content

Instantly share code, notes, and snippets.

@igstan
Created July 5, 2013 09:38
Show Gist options
  • Save igstan/5933352 to your computer and use it in GitHub Desktop.
Save igstan/5933352 to your computer and use it in GitHub Desktop.
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
}
}
@lukaseder
Copy link

Eew, that's subtle... Nice catch, though!

@igstan
Copy link
Author

igstan commented Jul 5, 2013

@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