As the screenshot shows above, the line 165 is an expression which has a type Tf.Tensor and this line is not the end line, the compiler does not give a warning for this line even though i have configured the scalacOption
-Wvalue-discard
.Here is my sbt config:
import org.scalajs.linker.interface.ModuleSplitStyle
lazy val root = project
.in(file("."))
.enablePlugins(ScalaJSPlugin)
.settings(
name := "bm3d-scalajs",
scalaVersion := "2.13.11",
scalacOptions ++= Seq(
"-encoding", "UTF-8",
"-unchecked",
"-deprecation",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Wvalue-discard",
"-Ywarn-unused"
),
scalaJSUseMainModuleInitializer := false,
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
.withModuleSplitStyle(ModuleSplitStyle.SmallModulesFor(List("bm3d")))
},
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.4.0",
"io.github.metarank" %% "cfor" % "0.3"
)
)
Is there a way to make the type checker give a warning for non-Unit type of expression?