当我将伴随对象添加到我的案例类时,我不能使用元组将参数作为元组传递。
case class Person(name:String, age:Int)
object Person {}
Person.tupled // Not works
Run Code Online (Sandbox Code Playgroud)
错误:
Error:(7, 9) value tupled is not a member of object A$A6.this.Person
Person.tupled
^
Run Code Online (Sandbox Code Playgroud)
有人可以解释这种行为吗?谢谢!