开发者

@BeanProperty causes "ambiguous reference" error, but does not appear to be ambiguous

class Foo(@BeanProperty var bar:String) {

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

}

This produces "error: ambiguous reference to overloaded definition, both method setBar in class Foo of type (x$1: String)Unit and method setBar in class Foo of type (d: Double)Unit match expected type ? class Foo(@BeanProperty var bar:String) {"

How can setBar(x:String) be ambiguous with setBar(d:Double)? Or is that 开发者_如何学Cnot what the error message is trying to convey?


Looks like a bug. Please file an ticket on issues.scala-lang.org.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜