implicits in scala Class constructors
问题 I dont understand why only one out of the three examples below are working? What makes the other two faulty? class H(implicit a:String, b: Int) { //Working } class H(a:String, implicit b: Int) { //Not-Working } class H(implicit a:String, implicit b: Int) { //Not-Working } 回答1: In the first case implicit doesn't refer to a but to the entire parameter list. It means " a and b can be provided implicitly when calling the constructor" (and also makes them available as implicits in the class body).