Skip to content

Commit

Permalink
Merge pull request #757 from mkurz/dbConfig_lazy
Browse files Browse the repository at this point in the history
Make dbConfig lazy to fix Scala 3 error
  • Loading branch information
mkurz authored Jul 15, 2023
2 parents 1c60a94 + 20d9536 commit b9b843d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 1 addition & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ lazy val commonSettings = Seq(
scalacOptions ~= (_.filterNot(_ == "-Xfatal-warnings")),
scalaVersion := "2.13.11", // scala213,
crossScalaVersions := Seq("2.13.11", "3.3.0"), // scala213,
scalacOptions ++= {
if (scalaBinaryVersion.value == "3") {
Seq("-source:3.0-migration")
} else {
Nil
}
},
pomExtra := scala.xml.NodeSeq.Empty, // Can be removed when dropping interplay
pomExtra := scala.xml.NodeSeq.Empty, // Can be removed when dropping interplay
developers += Developer(
"playframework",
"The Play Framework Contributors",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ object DatabaseConfigProvider {
trait HasDatabaseConfig[P <: BasicProfile] {

/** The Slick database configuration. */
protected val dbConfig: DatabaseConfig[P] // field is declared as a val because we want a stable identifier.
protected lazy val dbConfig: DatabaseConfig[P] =
??? // field is declared as a val because we want a stable identifier. // TODO: Remove "= ???" when dropping Scala 2
/** The Slick profile extracted from `dbConfig`. */
protected final lazy val profile: P = dbConfig.profile // field is lazy to avoid early initializer problems.
@deprecated("Use `profile` instead of `driver`", "2.1")
Expand Down

0 comments on commit b9b843d

Please sign in to comment.