我正在尝试使用Anorm docs逐字记录的示例:
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特有的吗?
答案 0 :(得分:0)
applicius'评论是正确的 - 稳定版本逐字逐句。一定是SNAPSHOT版本的一些问题。它发生了。