Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make dbConfig lazy to fix Scala 3 error #757

Merged
merged 1 commit into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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