0

What is the significance of 'implicit' in this code block? I have seen such code in a few places in my project. How should I be using it to leverage 'implicit'.

implicit val a: Int = 10
val decorate: Int => Int => String = x => implicit y => {
  "*" + x + y + "*"
}
println(decorate(5))

I expected it to print

*510*

but it only prints the partial function representation itself

playground.MyLearnings$$$Lambda$26/0x0000000800cb9f60@2cb4c3ab
beegee
  • 1

0 Answers0