Skip to content

Instantly share code, notes, and snippets.

@notyy
Created October 28, 2011 13:28
Show Gist options
  • Save notyy/1322257 to your computer and use it in GitHub Desktop.
Save notyy/1322257 to your computer and use it in GitHub Desktop.
cant infer
def newMap[A,B](x:A, f: A => B): B = {
f(x)
}
scala> newMap(1:Int,(_*2))
<console>:9: error: missing parameter type for expanded function ((x$1) => x$1.$times(2))
newMap(1:Int,(_*2))
^
scala> newMap(1,((_:Int)*2))
res7: Int = 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment