This is an automated email from the ASF dual-hosted git repository.

olabusayo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil.git


The following commit(s) were added to refs/heads/main by this push:
     new 515022039 Fix nullary with side effects error
515022039 is described below

commit 515022039e03bd993f383f2083e61a989a1e24c7
Author: olabusayoT <[email protected]>
AuthorDate: Wed Feb 19 14:11:11 2025 -0500

    Fix nullary with side effects error
    
    - remove explicit scala.collection.Seq from test
    - ignore nullary-unit error from tests and from TdmlTests trait
    
    DAFFODIL-2152
---
 build.sbt | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/build.sbt b/build.sbt
index 9c2cc5659..f579d660b 100644
--- a/build.sbt
+++ b/build.sbt
@@ -241,6 +241,7 @@ lazy val commonSettings = Seq(
   scalaVersion := "2.12.20",
   crossScalaVersions := Seq("2.12.20"),
   scalacOptions ++= buildScalacOptions(scalaVersion.value),
+  Test / scalacOptions ++= buildTestScalacOptions(scalaVersion.value),
   Compile / compile / javacOptions ++= buildJavacOptions(),
   logBuffered := true,
   transitiveClassifiers := Seq("sources", "javadoc"),
@@ -297,7 +298,25 @@ def buildScalacOptions(scalaVersion: String) = {
         // TODO: scala 2.12 phase out
         // the import is needed for Scala 2.12 but issues an unused import 
warning under 2.13, so we add this to
         // suppresss the warning
-        "-Wconf:origin=scala.collection.compat.*:s"
+        "-Wconf:origin=scala.collection.compat.*:s",
+        // suppress nullary-unit warning in the specific trait
+        
"-Wconf:cat=lint-nullary-unit:silent,site=org.apache.daffodil.junit.tdml.TdmlTests:silent"
+      )
+    case _ => Seq.empty
+  }
+
+  commonOptions ++ scalaVersionSpecificOptions
+}
+
+def buildTestScalacOptions(scalaVersion: String) = {
+  val commonOptions = Seq.empty
+
+  val scalaVersionSpecificOptions = CrossVersion.partialVersion(scalaVersion) 
match {
+    case Some((2, 12)) => Seq.empty
+    case Some((2, 13)) =>
+      Seq(
+        // suppress nullary-unit warning in tests
+        "-Wconf:cat=lint-nullary-unit:silent"
       )
     case _ => Seq.empty
   }

Reply via email to