【问题标题】:@BeanProperty causes "ambiguous reference" error, but does not appear to be ambiguous@BeanProperty 导致“模糊引用”错误,但似乎并不模糊
【发布时间】:2011-10-05 18:15:49
【问题描述】:
class Foo(@BeanProperty var bar:String) {

  def setBar(d:Double) {
    bar = d.toString
  }

}

这会产生“错误:对重载定义的模糊引用, Foo 类型 (x$1: String)Unit 中的两个方法 setBar 和类型为 (d: Double)Unit 的类 Foo 中的方法 setBar 匹配预期类型? 类 Foo(@BeanProperty var bar:String) {"

setBar(x:String) 和 setBar(d:Double) 怎么可能有歧义?或者这不是错误消息试图传达的内容?

【问题讨论】:

  • 尝试用@BeanInfo 标记整个班级,而不是用@BeanProperty 标记每个成员。也许这会有所帮助......

标签: scala


【解决方案1】:

看起来像一个错误。请在issues.scala-lang.org 提交工单。

【讨论】:

    猜你喜欢
    • 2022-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多