Implicit conversion from A to Some(a)
问题 out of curiosity, I was wondering if it was possible to do something like : def myMethod( a: Option[A] = None, b: Option[B] = None, ... z: Option[Z] = None ): Something = { ... } What I want is not to have to call it that way: myMethod( b = Some(newB), m = Some(newM) ) but instead being able to just do myMethod(b = newB, m = newM) without having to always convert A to Some(a) . Is it possible ? 回答1: Possible, yes: object Test { implicit def anythingToOption[A](a: A): Option[A] = Option(a) def