Skip to content

Commit

Permalink
Make fixes for 1691 work with more nested modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
yav committed Jul 3, 2024
1 parent 623ea9b commit d0a98a5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Cryptol/ModuleSystem/Renamer/ImplicitImports.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@ processModule dcl =
Private -> []
)

FunctorInstance {} -> ([dcl, mkImp loc [mname]], [])
FunctorInstance {} ->
let imps = [[mname]]
in ( dcl : map (mkImp loc) imps
, case tlExport m of
Public -> imps
Private -> []
)
InterfaceModule {} -> ([dcl], [])
_ -> panic "processModule" ["Not a module"]

Expand Down
12 changes: 12 additions & 0 deletions tests/issues/issue_1691_2.cry
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@


submodule F where
parameter x: Integer
y = x + 1

submodule B = submodule F where x = 2

submodule M where
submodule A where
a = 2
submodule B = submodule F where x = 2
2 changes: 2 additions & 0 deletions tests/issues/issue_1691_2.icry
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:load issue_1691_2.cry
:t M::B::y
4 changes: 4 additions & 0 deletions tests/issues/issue_1691_2.icry.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Loading module Cryptol
Loading module Cryptol
Loading module Main
M::B::y : Integer

0 comments on commit d0a98a5

Please sign in to comment.