Skip to content

Commit

Permalink
Fix freeVars calculation for TNominal
Browse files Browse the repository at this point in the history
Rather than computing the free variables of a `NominalType` definition, we only
include the name of the `NominalType` itself as a free variable.

Fixes #1773.
  • Loading branch information
RyanGlScott committed Nov 19, 2024
1 parent 8ba9700 commit 406f2c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <FILE> <EXPR>` updated to write to stdout when
Expand Down
3 changes: 2 additions & 1 deletion src/Cryptol/IR/FreeVars.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 406f2c3

Please sign in to comment.