Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Commit 5149c84

Browse files
committed
Enable fatal warnings everywhere.
1 parent d2966a4 commit 5149c84

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

Diff for: build.sbt

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ import org.scalajs.linker.interface.OutputPatterns
22

33
val scalaV = "2.13.12"
44

5+
inThisBuild(Def.settings(
6+
scalacOptions ++= Seq(
7+
"-encoding",
8+
"utf-8",
9+
"-feature",
10+
"-deprecation",
11+
"-Xfatal-warnings",
12+
)
13+
))
14+
515
lazy val cli = project
616
.in(file("cli"))
717
.enablePlugins(ScalaJSPlugin)

Diff for: wasm/src/main/scala/ir2wasm/WasmBuilder.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class WasmBuilder {
3232
}
3333
}
3434

35-
def transformTopLevelExport(export: LinkedTopLevelExport)(implicit ctx: WasmContext): Unit = {
35+
def transformTopLevelExport(topLevelExport: LinkedTopLevelExport)(implicit ctx: WasmContext): Unit = {
3636
implicit val fctx = WasmFunctionContext()
37-
export.tree match {
37+
topLevelExport.tree match {
3838
case d: IRTrees.TopLevelFieldExportDef => ???
3939
case d: IRTrees.TopLevelJSClassExportDef => ???
4040
case d: IRTrees.TopLevelMethodExportDef => transformToplevelMethodExportDef(d)
@@ -383,11 +383,11 @@ class WasmBuilder {
383383
)
384384
ctx.addFunction(func)
385385

386-
val export = new WasmExport.Function(
386+
val exprt = new WasmExport.Function(
387387
methodName.value,
388388
func
389389
)
390-
ctx.addExport(export)
390+
ctx.addExport(exprt)
391391
}
392392

393393
private def genFunction(

Diff for: wasm/src/main/scala/wasm4s/Wasm.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class WasmModule(
134134
def addFunctionType(typ: WasmFunctionType): Unit = _functionTypes.addOne(typ)
135135
def addRecGroupType(typ: WasmStructType): Unit = _recGroupTypes.addOne(typ)
136136
def addGlobal(typ: WasmGlobal): Unit = _globals.addOne(typ)
137-
def addExport(export: WasmExport[_]) = _exports.addOne(export)
137+
def addExport(exprt: WasmExport[_]) = _exports.addOne(exprt)
138138

139139
def functionTypes = _functionTypes.toList
140140
def recGroupTypes = WasmModule.tsort(_recGroupTypes.toList)
@@ -158,8 +158,8 @@ object WasmModule {
158158
} else {
159159
val found = noPreds.map { _._1 }.toSet
160160
val updated = hasPreds.map {
161-
case (k, Some(v)) => // should be safe because hasPreds has no None
162-
(k, if (found.contains(v)) None else Some(v))
161+
case (k, v) =>
162+
(k, v.filter(!found.contains(_)))
163163
}
164164
tsort(updated, done ++ found)
165165
}

Diff for: wasm/src/main/scala/wasm4s/WasmContext.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ trait FunctionTypeWriterWasmContext extends ReadOnlyWasmContext { this: WasmCont
124124

125125
class WasmContext(val module: WasmModule) extends FunctionTypeWriterWasmContext {
126126
import WasmContext._
127-
def addExport(export: WasmExport[_]): Unit = module.addExport(export)
127+
def addExport(exprt: WasmExport[_]): Unit = module.addExport(exprt)
128128
def addFunction(fun: WasmFunction): Unit = {
129129
module.addFunction(fun)
130130
functions.define(fun)

0 commit comments

Comments
 (0)