Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of Cryptol newtype #1870

Closed
yav opened this issue May 16, 2023 · 1 comment
Closed

Incorrect handling of Cryptol newtype #1870

yav opened this issue May 16, 2023 · 1 comment
Assignees

Comments

@yav
Copy link
Member

yav commented May 16, 2023

The following program panics:

import "test.cry";    
                                                                            
print {{ A { x = 2 } }};

where test.cry is like this:

newtype A = { x : 8 }
@RyanGlScott
Copy link
Contributor

For reference, the panic is:

$ ./bin/saw test.saw



[16:47:21.971] Loading file "/home/rscott/Documents/Hacking/Haskell/saw-script/test.saw"
[16:47:22.037] You have encountered a bug in Cryptol's implementation.
*** Please create an issue at https://github.com/GaloisInc/cryptol/issues

%< --------------------------------------------------- 
  Revision:  9382d527543db70068b71fe3a327cd07fe0b36c8
  Branch:    HEAD
  Location:  Cryptol.TypeCheck.TypeOf.fastSchemaOf
  Message:   EVar failed to find type variable:
             Name {nUnique = 4775, nInfo = Declared (TopModule (ModName "Main")) UserName, nNamespace = NSType, nIdent = Ident False "A", nFixity = Nothing, nLoc = Range {from = Position {line = 1, col = 9}, to = Position {line = 1, col = 10}, source = "test.cry"}}
CallStack (from HasCallStack):
  panic, called at src/Cryptol/Utils/Panic.hs:21:9 in cryptol-2.13.0.99-inplace:Cryptol.Utils.Panic
  panic, called at src/Cryptol/TypeCheck/TypeOf.hs:74:37 in cryptol-2.13.0.99-inplace:Cryptol.TypeCheck.TypeOf
%< ---------------------------------------------------

@yav yav self-assigned this May 16, 2023
yav added a commit that referenced this issue May 16, 2023
@yav yav closed this as completed in cbd03df May 23, 2023
yav added a commit that referenced this issue May 23, 2023
Add types for `newtype` constructors.  Fixes #1870
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants