In Scala 2 I could have written something like this:
// a function that needs an implicit context
def funcWithCtx(arg1: String)(implicit ctx: Context) = ???
myObj.doSomething { implicit ctx => // mark argument as the implicit context
funcWithCtx("arg1")
}
This syntax works in Scala 3, but I thought implicit was being deprecated and given \ using was being used instead? I've tried to replace implicit with given but the compiler doesn't like that.
myObj.doSomething { given x => // this fails!
...
}
Is this one place where the implicit keyword is still required?