Skip to content

Commit 5c79c84

Browse files
authored
fix(compiler): Ensure the extension is chopped in the case of module name error (#2060)
1 parent c790adc commit 5c79c84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/typed/module_resolution.re

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,13 @@ let try_locate_module =
236236
| exception Not_found => error(No_module_file(loc, name, None))
237237
| _ =>
238238
let name = !is_relpath(name) ? no_extension : name;
239+
// The filepath might have come in as `.gr.gr` so we need to chop again
240+
let module_name = chop_suffix(no_extension, ".gr");
239241
error(
240242
No_module_file(
241243
loc,
242244
name,
243-
Some("did you mean \"" ++ no_extension ++ "\"?"),
245+
Some("did you mean \"" ++ module_name ++ "\"?"),
244246
),
245247
);
246248
};

0 commit comments

Comments
 (0)