Skip to content

Commit 62949b0

Browse files
committed
Revert "Convert verification errors into diagnostics, closes #14768"
This reverts commit 2dc3d27. This solution will still leave a corrupted state if verification is manually aborted.
1 parent cb108d5 commit 62949b0

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
lines changed

lib/elixir/lib/module/parallel_checker.ex

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -283,21 +283,7 @@ defmodule Module.ParallelChecker do
283283
|> emit_warnings(file, log?)
284284

285285
Enum.each(after_verify, fn {verify_mod, verify_fun} ->
286-
try do
287-
apply(verify_mod, verify_fun, [module])
288-
catch
289-
# We need to catch exceptions because files have already been written to disk,
290-
# so we need to convert verification errors into diagnostics by using IO.warn.
291-
kind, reason ->
292-
IO.warn(
293-
"exception happened while verifying module #{inspect(module)}\n\n" <>
294-
Exception.format(kind, reason, __STACKTRACE__),
295-
file: file,
296-
line: line,
297-
module: verify_mod,
298-
function: {verify_fun, 1}
299-
)
300-
end
286+
apply(verify_mod, verify_fun, [module])
301287
end)
302288

303289
diagnostics

lib/elixir/test/elixir/module/types/integration_test.exs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,27 +1225,6 @@ defmodule Module.Types.IntegrationTest do
12251225

12261226
assert_warnings(files, warning)
12271227
end
1228-
1229-
test "converts errors into diagnostics" do
1230-
files = %{
1231-
"a.ex" => """
1232-
defmodule A do
1233-
@after_verify __MODULE__
1234-
1235-
def __after_verify__(__MODULE__) do
1236-
raise "oops"
1237-
end
1238-
end
1239-
"""
1240-
}
1241-
1242-
warning = [
1243-
"warning: exception happened while verifying module A",
1244-
"** (RuntimeError) oops"
1245-
]
1246-
1247-
assert_warnings(files, warning)
1248-
end
12491228
end
12501229

12511230
describe "deprecated" do

0 commit comments

Comments
 (0)