Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
object OverloadSample {
implicit class B2I(f: Boolean => Int)
implicit class I2I(f: Int => Int)
def foo(func: B2I): Unit = {
println("test")
}
def foo(func: I2I): Unit = {
println("test")
}
def main(args: Array[String]): Unit = {
val test = (tf: Boolean) => 0
foo(test)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.