diff --git a/CHANGES.md b/CHANGES.md index 7bbec3ef7..d752c6146 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ * Fix a bug in which splitting a `[0]` value into type `[inf][0]` would panic. ([#1749](https://github.com/GaloisInc/cryptol/issues/1749)) +* Fix a bug in which the free variables of types mentioning newtypes or enums + were incorrectly computed. + ([#1773](https://github.com/GaloisInc/cryptol/issues/1773)) + ## New features * REPL command `:dumptests ` updated to write to stdout when diff --git a/src/Cryptol/IR/FreeVars.hs b/src/Cryptol/IR/FreeVars.hs index b051fe770..4d3b5d330 100644 --- a/src/Cryptol/IR/FreeVars.hs +++ b/src/Cryptol/IR/FreeVars.hs @@ -159,7 +159,8 @@ instance FreeVars Type where TUser _ _ t -> freeVars t TRec fs -> freeVars (recordElements fs) - TNominal nt ts -> freeVars nt <> freeVars ts + TNominal nt ts -> mempty { tyDeps = Set.singleton (ntName nt) } + <> freeVars ts instance FreeVars TVar where freeVars tv = case tv of