Skip to content

Commit 7090819

Browse files
yavchameco
authored andcommitted
Add newtype constructors to thje typing environment.
Fixes #1870
1 parent f90c08e commit 7090819

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cryptol-saw-core/src/Verifier/SAW/CryptolEnv.hs

+6-2
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,12 @@ mkCryEnv env =
304304
liftModuleM modEnv $
305305
do prims <- MB.getPrimMap
306306
-- noIfaceParams because we don't support translating functors yet
307-
TM.inpVars `fmap` MB.genInferInput P.emptyRange prims
308-
NoParams ifaceDecls
307+
infInp <- MB.genInferInput P.emptyRange prims NoParams ifaceDecls
308+
let newtypeCons = Map.fromList
309+
[ (T.ntConName nt, T.newtypeConType nt)
310+
| nt <- Map.elems (TM.inpNewtypes infInp)
311+
]
312+
pure (newtypeCons `Map.union` TM.inpVars infInp)
309313
let types' = Map.union (eExtraTypes env) types
310314
let terms = eTermEnv env
311315
let cryEnv = C.emptyEnv

0 commit comments

Comments
 (0)