Skip to content

Commit

Permalink
Merge pull request #1245 from GaloisInc/T1240
Browse files Browse the repository at this point in the history
The types of module parameters use constraints
  • Loading branch information
yav authored Jul 22, 2021
2 parents 5b21f36 + 31cd9fe commit e78195a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Cryptol/ModuleSystem/Renamer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,12 @@ renameTopDecls' info ds =
TDNewtype {} -> False
DParameterType {} -> False
DParameterConstraint {} -> False
DParameterFun {} -> False

DParameterFun {} -> True
-- Here we may need the constraints to validate the type
-- (e.g., if the parameter is of type `Z a`)


DModule tl -> any usesCtrs (mDecls m)
where NestedModule m = tlValue tl
DImport {} -> False
Expand Down
8 changes: 8 additions & 0 deletions tests/issues/issue1240.cry
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module test where

parameter

type a : #
type constraint (fin a, a >= 1)

b : Z a
1 change: 1 addition & 0 deletions tests/issues/issue1240.icry
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:load issue1240.cry
3 changes: 3 additions & 0 deletions tests/issues/issue1240.icry.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Loading module Cryptol
Loading module Cryptol
Loading module test

0 comments on commit e78195a

Please sign in to comment.