當我有一個從XML節點提取作用對象的方法:斯卡拉+電梯:Ambigous隱式轉換解析XML
private def appendActionsFromXml(device: Device, xml: Node) = {
xml \ "actions" \ "action" map {
x => {
val key = x \ "@key" text
val value = x \ "@value" text
device.createAction(key, value)
}
}
}
但是,因爲我已經導入進口net.liftweb.json.JsonDSL。 _在同一個班級,我得到一個ambigouity當我從X提取「@key」 -attribute:
[INFO] Note that implicit conversions are not applicable because they are ambiguous
[INFO] both method string2jvalue in trait Implicits of type (x: String)net.liftweb.json.JsonAST.JString
[INFO] and method augmentString in object Predef of type (x: String)scala.collection.immutable.StringOps
[INFO] are possible conversion functions from String to ?{val apply: ?}
[INFO] val value = x \ "@value" text
如何在這個perticular方法解決此ambigouity?