Skip to content

Commit

Permalink
properly filter out 'default' when re-exporting names
Browse files Browse the repository at this point in the history
  • Loading branch information
zindel committed Aug 21, 2018
1 parent 738f3bd commit 47eff04
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Fastpack/ExportFinder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ let make () =
let exports =
M.merge
(fun key v1 v2 ->
match key with
| "default" -> None
| _ ->
match v1, v2 with
| Some v1, Some v2 ->
match v1, v2 with
| Some v1, Some v2 ->
if key = "default"
then Some v1
else
(* TODO: define proper error here *)
failwith ("ExportFinder > Cannot export twice: " ^ key ^ ". Module 1: " ^ (Module.location_to_string v1.parent_module.location) ^ ". Module 2: " ^ (Module.location_to_string v2.parent_module.location))
| Some v, None | None, Some v ->
Some v
| None, None ->
None
| Some v, None | None, Some v ->
Some v
| None, None ->
None
)
exports
batch_exports
Expand Down

0 comments on commit 47eff04

Please sign in to comment.