@@ -3,6 +3,7 @@ import sbt.{ Def, Global, Tags }
33
44import scala .collection .immutable .SortedSet
55import MonixBuildUtils ._
6+ import org .typelevel .scalacoptions .ScalacOptions
67
78val benchmarkProjects = List (
89 " benchmarksPrev" ,
@@ -31,9 +32,9 @@ val reactiveStreams_Version = "1.0.4"
3132val macrotaskExecutor_Version = " 1.0.0"
3233val minitest_Version = " 2.9.6"
3334val implicitBox_Version = " 0.3.4"
34- val kindProjector_Version = " 0.13.2 "
35+ val kindProjector_Version = " 0.13.4 "
3536val betterMonadicFor_Version = " 0.3.1"
36- val silencer_Version = " 1.7.8 "
37+ val silencer_Version = " 1.7.19 "
3738val scalaCompat_Version = " 2.7.0"
3839
3940// The Monix version with which we must keep binary compatibility.
@@ -189,8 +190,19 @@ lazy val sharedSettings = pgpSettings ++ Seq(
189190 " -Wunused:explicits" ,
190191 " -Ywarn-unused:params" ,
191192 " -Wunused:params" ,
192- " -Xlint:infer-any"
193+ " -Xlint:infer-any" ,
194+ " -Wnonunit-statement"
193195 ),
196+ // Disabled from tpolecat for test compilation:
197+ // -Wunused:patvars triggers on for-comprehension loop vars in tests (pre-existing pattern)
198+ // -Xlint:constant triggers on intentional overflow tests (e.g. Long.MaxValue + 1)
199+ Test / scalacOptions --= {
200+ CrossVersion .partialVersion(scalaVersion.value) match {
201+ case Some ((2 , 13 )) => Seq (" -Wunused:patvars" , " -Xlint:constant" )
202+ case Some ((2 , 12 )) => Seq (" -Ywarn-unused:patvars" )
203+ case _ => Seq .empty
204+ }
205+ },
194206 // Turning off fatal warnings for doc generation
195207 Compile / doc / tpolecatExcludeOptions ++= ScalacOptions .defaultConsoleExclude,
196208 // Silence everything in auto-generated files
@@ -202,7 +214,9 @@ lazy val sharedSettings = pgpSettings ++ Seq(
202214 },
203215 scalacOptions --= {
204216 if (isDotty.value)
205- Seq (" -Xfatal-warnings" )
217+ // tpolecat uses -Werror in Scala 3; disable fatal warnings
218+ // so that pre-existing value-discard and similar patterns don't break Scala 3 builds
219+ Seq (" -Werror" )
206220 else
207221 Seq ()
208222 },
0 commit comments