Skip to content

Commit 19816e1

Browse files
committed
Report more warnings for pattern match
1 parent 473e765 commit 19816e1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compiler/src/dotty/tools/dotc/transform/init/Objects.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,9 @@ object Objects:
11091109

11101110
case Match(selector, cases) =>
11111111
eval(selector, thisV, klass)
1112-
evalExprs(cases.map(_.body), thisV, klass).join
1112+
// TODO: handle pattern match properly
1113+
report.warning("[initChecker] Pattern match is skipped. Trace:\n" + Trace.show, expr)
1114+
Bottom
11131115

11141116
case Return(expr, from) =>
11151117
Returns.handle(from.symbol, eval(expr, thisV, klass))

project/Build.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ object Build {
193193
"-deprecation",
194194
"-unchecked",
195195
//"-Wconf:cat=deprecation&msg=Unsafe:s", // example usage
196-
"-Xfatal-warnings", // -Werror in modern usage
196+
// "-Xfatal-warnings", // -Werror in modern usage
197197
"-encoding", "UTF8",
198198
"-language:implicitConversions",
199199
),
@@ -803,7 +803,7 @@ object Build {
803803
},
804804

805805
// Note: bench/profiles/projects.yml should be updated accordingly.
806-
Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Ysafe-init"),
806+
Compile / scalacOptions ++= Seq("-Yexplicit-nulls", "-Ysafe-init", "-Ysafe-init-global"),
807807

808808
repl := (Compile / console).value,
809809
Compile / console / scalacOptions := Nil, // reset so that we get stock REPL behaviour! E.g. avoid -unchecked being enabled

0 commit comments

Comments
 (0)