Skip to content

Commit

Permalink
fix(compiler): Ensure the extension is chopped in the case of module …
Browse files Browse the repository at this point in the history
…name error (#2060)
  • Loading branch information
phated committed Mar 4, 2024
1 parent c790adc commit 5c79c84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/src/typed/module_resolution.re
Expand Up @@ -236,11 +236,13 @@ let try_locate_module =
| exception Not_found => error(No_module_file(loc, name, None))
| _ =>
let name = !is_relpath(name) ? no_extension : name;
// The filepath might have come in as `.gr.gr` so we need to chop again
let module_name = chop_suffix(no_extension, ".gr");
error(
No_module_file(
loc,
name,
Some("did you mean \"" ++ no_extension ++ "\"?"),
Some("did you mean \"" ++ module_name ++ "\"?"),
),
);
};
Expand Down

0 comments on commit 5c79c84

Please sign in to comment.