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

Commit 7031e1d

Browse files
committed
Enable fatal warnings everywhere.
1 parent 1f9b80c commit 7031e1d

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)
@@ -370,11 +370,11 @@ class WasmBuilder {
370370
)
371371
ctx.addFunction(func)
372372

373-
val export = new WasmExport.Function(
373+
val exprt = new WasmExport.Function(
374374
methodName.value,
375375
func
376376
)
377-
ctx.addExport(export)
377+
ctx.addExport(exprt)
378378
}
379379

380380
private def genFunction(

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

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

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

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

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

9797
class WasmContext(val module: WasmModule) extends FunctionTypeWriterWasmContext {
9898
import WasmContext._
99-
def addExport(export: WasmExport[_]): Unit = module.addExport(export)
99+
def addExport(exprt: WasmExport[_]): Unit = module.addExport(exprt)
100100
def addFunction(fun: WasmFunction): Unit = {
101101
module.addFunction(fun)
102102
functions.define(fun)

0 commit comments

Comments
 (0)