Skip to content

Commit 14db204

Browse files
authored
feat(compiler): Support raising multiple well formedness errors. (#2348)
1 parent cf6b82b commit 14db204

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

compiler/src/parsing/well_formedness.re

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,13 @@ let check_well_formedness = program => {
917917

918918
Parsetree_iter.iter_parsed_program(iter_hooks, program);
919919

920-
// TODO(#1503): We should be able to raise _all_ errors at once
921-
List.iter(e => raise(Error(e)), errs^);
920+
switch (errs^) {
921+
| [final, ...rest] =>
922+
List.iter(
923+
e => Location.report_exception(Format.err_formatter, Error(e)),
924+
rest,
925+
);
926+
raise(Error(final));
927+
| [] => ()
928+
};
922929
};

0 commit comments

Comments
 (0)