Skip to content

Commit a1ee29c

Browse files
committed
get the module VarE's type right
1 parent 957f912 commit a1ee29c

9 files changed

+4
-36
lines changed

src/lowering/desugar.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,9 @@ let link_declarations imports (cu, flavor) =
859859

860860
let transform_import (i : S.import) : import_declaration =
861861
let (mid, f, ir) = i.it in
862-
let t = i.note in
862+
let t = match mid with
863+
| Surface _ -> i.note
864+
| Bulk (_, mod_note) -> mod_note.note_typ in
863865
assert (t <> T.Pre);
864866
let rhs = match !ir with
865867
| S.Unresolved -> raise (Invalid_argument ("Unresolved import " ^ f))
@@ -871,7 +873,7 @@ let transform_import (i : S.import) : import_declaration =
871873
primE (I.ActorOfIdBlob t) [blobE canister_id]
872874
in [ match mid with
873875
| Surface id -> letD (var id.it t) rhs
874-
| Bulk (id, _) -> letD (var id.it t) (dotE rhs id.it t)]
876+
| Bulk (id, _) -> letD (var id.it i.note) (dotE rhs id.it i.note)]
875877

876878
let transform_unit_body (u : S.comp_unit_body) : Ir.comp_unit =
877879
match u.it with

test/run/ok/import-module-explicit.comp.ok

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/run/ok/import-module-explicit.comp.ret.ok

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/run/ok/import-module-explicit.diff-ir.ok

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/run/ok/import-module-explicit.diff-low.ok

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/run/ok/import-module-explicit.run-ir.ok

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/run/ok/import-module-explicit.run-ir.ret.ok

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/run/ok/import-module-explicit.run-low.ok

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/run/ok/import-module-explicit.run-low.ret.ok

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)