【发布时间】:2014-10-07 02:01:17
【问题描述】:
我正在逐字尝试 Anorm 文档中的示例:
import anorm._
DB.withConnection { implicit c =>
val result: Boolean = SQL("Select 1").execute()
}
我收到此错误:
[error] /Users/Greg/git/slurpee/src/test/scala/ReaderTests.scala:115: type mismatch;
[error] found : anorm.SqlQuery
[error] required: ?{def execute: ?}
[error] Note that implicit conversions are not applicable because they are ambiguous:
[error] both method sqlToSimple in package anorm of type (sql: anorm.SqlQuery)anorm.SimpleSql[anorm.Row]
[error] and method sqlToBatch in package anorm of type (sql: anorm.SqlQuery)anorm.BatchSql
[error] are possible conversion functions from anorm.SqlQuery to ?{def execute: ?}
[error] SQL("select 1;").execute()
这是 2.4 特有的吗?
【问题讨论】:
-
您应该尝试使用 2.4-M1 或稳定的 2.3.4
-
就是这样。 v2.3.5 和宣传的一样好。