diff --git a/build.sbt b/build.sbt index 3cd53efa7..12a907c1c 100644 --- a/build.sbt +++ b/build.sbt @@ -50,6 +50,9 @@ inThisBuild( ) ) +def inferOverrideFor2_13(version: String): Seq[String] = + if (version.startsWith("2.13")) Seq("-Xsource-features:infer-override") else Nil + def disableMissingInterpolatorWarning(options: Seq[String]): Seq[String] = options.map { opt => if (opt.startsWith("-Xlint")) opt + ",-missing-interpolator" else opt @@ -134,6 +137,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform) "org.scalameta" %%% "munit" % versions.munit % "test", "org.typelevel" %%% "cats-core" % versions.catsCore ), + scalacOptions ++= inferOverrideFor2_13(scalaVersion.value), Test / scalacOptions ~= disableMissingInterpolatorWarning ) .jvmSettings( diff --git a/core/shared/src/main/scala/laika/internal/parse/hocon/ConfigResolver.scala b/core/shared/src/main/scala/laika/internal/parse/hocon/ConfigResolver.scala index ade10c27b..bc983a1a3 100644 --- a/core/shared/src/main/scala/laika/internal/parse/hocon/ConfigResolver.scala +++ b/core/shared/src/main/scala/laika/internal/parse/hocon/ConfigResolver.scala @@ -296,7 +296,7 @@ private[laika] object ConfigResolver { obj.values.groupBy(_.key.getOrElse(Key.root)).mapValuesStrict(_.map(_.value)).toSeq.map { case (key, values) => val merged = values.reduce(mergeValues(key)) match { - case obj: ObjectBuilderValue => mergeObjects(obj) + case obv: ObjectBuilderValue => mergeObjects(obv) case other => other } BuilderField(key, merged) @@ -373,8 +373,8 @@ private[laika] object ConfigResolver { extract(field + "." + index, arrValue) } if (nested.isEmpty) wrap(failure) else nested - case InvalidBuilderValue(obj: ObjectBuilderValue, failure) => - val nested = extractErrors(obj) + case InvalidBuilderValue(obv: ObjectBuilderValue, failure) => + val nested = extractErrors(obv) if (nested.isEmpty) wrap(failure) else nested case InvalidBuilderValue(_, failure) => wrap(failure) case incl: IncludeBuilderValue =>