【发布时间】:2014-02-10 14:06:01
【问题描述】:
[error] both method addVertex in class OrientBaseGraph of type (x$1: Any, x$2: <repeated...>[Object])com.tinkerpop.blueprints.impls.orient.OrientVertex
[error] and method addVertex in class OrientBaseGraph of type (x$1: Any)com.tinkerpop.blueprints.impls.orient.OrientVertex
[error] match argument types (String)
[error] val npNode = g.addVertex(f"class:$NPPhrase")
[error]
如何让 Scala 选择我尝试调用的方法(更具体的方法)?
哦,虽然在这种情况下g.addVertext(...,Nil) 在语义上是等价的,但我仍然想知道如何解决上述问题。
【问题讨论】:
-
请出示密码!
-
你会用代码做什么?它只是一个以字符串为输入的方法。好吧,也许你需要看看
NPPhrase是什么:def NPPhrase = "NPChunkPhrase" -
干杯,有一个明智的答案(创建一个 java 消歧类")。投票结束。
标签: scala overloading