Skip to content

Commit

Permalink
Report more warnings for pattern match
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed Jun 15, 2023
1 parent 473e765 commit 19816e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/init/Objects.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,9 @@ object Objects:

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

case Return(expr, from) =>
Returns.handle(from.symbol, eval(expr, thisV, klass))
Expand Down
4 changes: 2 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ object Build {
"-deprecation",
"-unchecked",
//"-Wconf:cat=deprecation&msg=Unsafe:s", // example usage
"-Xfatal-warnings", // -Werror in modern usage
// "-Xfatal-warnings", // -Werror in modern usage
"-encoding", "UTF8",
"-language:implicitConversions",
),
Expand Down Expand Up @@ -803,7 +803,7 @@ object Build {
},

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

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

0 comments on commit 19816e1

Please sign in to comment.