Skip to content

Commit

Permalink
Scala3 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cchantep committed Apr 13, 2023
1 parent 8081986 commit 7172d4b
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala-3/anorm/Macro.scala
Original file line number Diff line number Diff line change
@@ -244,7 +244,7 @@ object Macro extends MacroOptions with macros.ValueColumn with macros.ValueToSta
* @param projection $projectionParam
* @tparam T $caseTParam
*/
inline def toParameters[T](inline separator: String, projection: ParameterProjection*): ToParameterList[T] = ${
inline def toParameters[T](inline separator: String, inline projection: ParameterProjection*): ToParameterList[T] = ${
parametersWithSeparator[T]('separator, 'projection)
}

@@ -484,7 +484,7 @@ object Macro extends MacroOptions with macros.ValueColumn with macros.ValueToSta
private def parametersWithSeparator[T](
separator: Expr[String],
projection: Expr[Seq[ParameterProjection]]
)(using q: Quotes, tpe: Type[T]): Expr[ToParameterList[T]] = {
)(using q: Quotes, tpe: Type[T], proj: Type[ParameterProjection]): Expr[ToParameterList[T]] = {
import q.reflect.*

'{
16 changes: 9 additions & 7 deletions docs/manual/working/scalaGuide/main/sql/code/ScalaAnorm.scala
Original file line number Diff line number Diff line change
@@ -19,15 +19,17 @@ class ScalaAnorm extends org.specs2.mutable.Specification {

"Anorm" should {
"be usable in play" in new WithApplication(createApp(additionalConfiguration = inMemoryDatabase())) {
val database = app.injector.instanceOf[Database]
// #playdb
import anorm._
override def running() = {
val database = app.injector.instanceOf[Database]
// #playdb
import anorm._

database.withConnection { implicit c =>
val _: Boolean = SQL("Select 1").execute()
database.withConnection { implicit c =>
val _: Boolean = SQL("Select 1").execute()
}
// #playdb
ok
}
// #playdb
ok
}
}
}

0 comments on commit 7172d4b

Please sign in to comment.