File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -276,12 +276,23 @@ let traverseAst = {
276276 };
277277 let raisesAnnotationPayload =
278278 vb. vb_attributes |> Annotation . getAttributePayload((== )("raises" ));
279- let exceptions =
280- switch (raisesAnnotationPayload) {
281- | Some (Annotation . StringPayload (s ) | Annotation . ConstructPayload (s )) =>
279+ let rec getExceptions = payload =>
280+ switch (payload) {
281+ | Annotation . StringPayload (s ) => Exn . fromString(s) |> ExnSet . singleton
282+ | Annotation . ConstructPayload (s ) =>
282283 Exn . fromString(s) |> ExnSet . singleton
284+ | Annotation . TuplePayload (tuple ) =>
285+ tuple
286+ |> List . map(payload => payload |> getExceptions |> ExnSet . elements)
287+ |> List . concat
288+ |> ExnSet . of_list
283289 | _ => ExnSet . empty
284290 };
291+ let exceptions =
292+ switch (raisesAnnotationPayload) {
293+ | None => ExnSet . empty
294+ | Some (payload ) => payload |> getExceptions
295+ };
285296 Hashtbl . replace(valueBindingsTable, Ident . name(id), exceptions);
286297 let res = super. value_binding(self, vb);
287298 let raiseSet = currentEvents^ |> Event . combine;
You can’t perform that action at this time.
0 commit comments