Skip to content

Commit c87aa2c

Browse files
committed
Remove -Wsafe-init option
scala/scala3#22442
1 parent 5acb1f5 commit c87aa2c

File tree

3 files changed

+29
-32
lines changed

3 files changed

+29
-32
lines changed

build.sbt

-4
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ val commonSettings = Seq(
5353
ScalacOptions.other("-indent"),
5454
ScalacOptions.explain,
5555
ScalacOptions.release("21"),
56-
ScalacOptions.other(
57-
"-Wsafe-init"
58-
), // fix in: https://github.com/typelevel/scalac-options/pull/136
5956
),
6057
libraryDependencies ++= Seq(
6158
Dependencies.catsCore.value,
@@ -76,7 +73,6 @@ val commonJsSettings = Seq(
7673
)
7774

7875
val kantan = crossProject(JSPlatform, JVMPlatform)
79-
.settings(scalacOptions -= "-Xfatal-warnings", scalacOptions += "-Wconf:all")
8076
.jsSettings(commonJsSettings)
8177

8278
val compiler = crossProject(JSPlatform, JVMPlatform)

compiler/shared/src/test/scala/grox/ExprFlatten.scala

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ extension (e: Expr)
3131
case Expr.Literal(tag, true) => List(True(tag))
3232
case Expr.Literal(tag, false) => List(False(tag))
3333
case Expr.Literal(tag, ()) => List(Null(tag))
34+
case _ => List.empty

compiler/shared/src/test/scala/grox/InterpreterTest.scala

+28-28
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ class InterpreterTest extends CatsEffectSuite with ScalaCheckEffectSuite:
112112
val divisionWithX = eval("-4*(x+3*4-2*2)")
113113

114114
(expr, division).mapN((x, y) => assert(x == y)) >>
115-
(division, multiplication).mapN((x, y) => assert(x == y)) >>
116-
(multiplication, addition).mapN((x, y) => assert(x == y)) >>
117-
(addition, subtraction).mapN((x, y) => assert(x == y)) >>
118-
(subtraction, answer).mapN((x, y) => assert(x == y)) >>
119-
(exprWithX, answer).mapN((x, y) => assert(x == y)) >>
120-
(divisionWithX, answer).mapN((x, y) => assert(x == y))
115+
(division, multiplication).mapN((x, y) => assert(x == y)) >>
116+
(multiplication, addition).mapN((x, y) => assert(x == y)) >>
117+
(addition, subtraction).mapN((x, y) => assert(x == y)) >>
118+
(subtraction, answer).mapN((x, y) => assert(x == y)) >>
119+
(exprWithX, answer).mapN((x, y) => assert(x == y)) >>
120+
(divisionWithX, answer).mapN((x, y) => assert(x == y))
121121

122122
test("division by zero error"):
123123
evaluate(Expr.Divide(empty, Expr.Literal(empty, 1), Expr.Literal(empty, 0)))
@@ -127,14 +127,14 @@ class InterpreterTest extends CatsEffectSuite with ScalaCheckEffectSuite:
127127
test("logical or"):
128128
evaluate(Expr.Or(empty, Expr.Literal(empty, true), Expr.Literal(empty, false)))
129129
.map(x => assert(x == true)) >>
130-
evaluate(Expr.Or(empty, Expr.Literal(empty, false), Expr.Literal(empty, false)))
131-
.map(x => assert(x == false))
130+
evaluate(Expr.Or(empty, Expr.Literal(empty, false), Expr.Literal(empty, false)))
131+
.map(x => assert(x == false))
132132

133133
test("logical and"):
134134
evaluate(Expr.And(empty, Expr.Literal(empty, true), Expr.Literal(empty, false)))
135135
.map(x => assert(x == false)) >>
136-
evaluate(Expr.And(empty, Expr.Literal(empty, false), Expr.Literal(empty, false)))
137-
.map(x => assert(x == false))
136+
evaluate(Expr.And(empty, Expr.Literal(empty, false), Expr.Literal(empty, false)))
137+
.map(x => assert(x == false))
138138

139139
test("must be numbers or strings runtime error"):
140140
evaluate(Expr.Add(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
@@ -153,21 +153,21 @@ class InterpreterTest extends CatsEffectSuite with ScalaCheckEffectSuite:
153153
evaluate(Expr.Subtract(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
154154
.attempt
155155
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
156-
evaluate(Expr.Divide(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
157-
.attempt
158-
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
159-
evaluate(Expr.Multiply(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
160-
.attempt
161-
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
162-
evaluate(Expr.Greater(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
163-
.attempt
164-
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
165-
evaluate(Expr.GreaterEqual(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
166-
.attempt
167-
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
168-
evaluate(Expr.Less(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
169-
.attempt
170-
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
171-
evaluate(Expr.LessEqual(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
172-
.attempt
173-
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty))))
156+
evaluate(Expr.Divide(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
157+
.attempt
158+
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
159+
evaluate(Expr.Multiply(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
160+
.attempt
161+
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
162+
evaluate(Expr.Greater(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
163+
.attempt
164+
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
165+
evaluate(Expr.GreaterEqual(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
166+
.attempt
167+
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
168+
evaluate(Expr.Less(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
169+
.attempt
170+
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty)))) >>
171+
evaluate(Expr.LessEqual(empty, Expr.Literal(empty, 1), Expr.Literal(empty, "string")))
172+
.attempt
173+
.map(x => assert(x == Left(RuntimeError.MustBeNumbers(empty))))

0 commit comments

Comments
 (0)