Skip to content

Commit a922be0

Browse files
committed
fix regression with unit qualification
Fixes #428 The change in #418 introduced a regression if a `Unit` module in scope does not have a `()` constructor in it. This switches to the more explicit `Stdlib.Unit.()` path.
1 parent 0e9f0c6 commit a922be0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
unreleased
22
----------
33

4+
* Fix regression with unit qualification when a `Unit` module is in scope with
5+
no `()` constructor (#429, fixes #428, @emillon)
6+
47
* emacs: add completion-at-point implementation (#406, fixes #261, @j-shilling)
58

69
2.12.0 (2023-04-17)

src/lib/uTop.ml

+4-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,10 @@ let check_phrase phrase =
349349
let env = !Toploop.toplevel_env in
350350
(* Construct "let _ () = let module _ = struct <items> end in ()" in order to test
351351
the typing and compilation of [items] without evaluating them. *)
352-
let unit = with_loc loc (Longident.Ldot (Lident "Unit", "()")) in
352+
let unit =
353+
let (%.) a b = Longident.Ldot (a, b) in
354+
with_loc loc (Lident "Stdlib" %. "Unit" %. "()")
355+
in
353356
let top_def =
354357
let open Ast_helper in
355358
with_default_loc loc

0 commit comments

Comments
 (0)