【发布时间】:2013-11-14 04:32:15
【问题描述】:
所以我尝试声明这个简单的案例类
case class Association(id: Option[Long], type: String, name: String, description: Option[String], uri: URI, additonalInfo: String){
}
但它不会与此消息一起编译:
- identifier expected but 'type' found.
这当然是因为“type”是一个保留的 Scala 关键字。由于某些原因,我认为我可以通过提供 'type (Symbol) 来解决这个问题,但它仍然无法编译。
那么我如何才能真正将我的参数标记为“类型”? 请不要让我失望,告诉我这不能在 Scala 中完成 :)
【问题讨论】:
标签: scala