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

fixity problem for type operators #666

Closed
ramsdell opened this issue Dec 2, 2019 · 2 comments
Closed

fixity problem for type operators #666

ramsdell opened this issue Dec 2, 2019 · 2 comments

Comments

@ramsdell
Copy link

ramsdell commented Dec 2, 2019

cbc-steal.cry.txt

The above file produces the following output:

$ cryptol cbc-steal.cry
┏━╸┏━┓╻ ╻┏━┓╺┳╸┏━┓╻
┃ ┣┳┛┗┳┛┣━┛ ┃ ┃ ┃┃
┗━╸╹┗╸ ╹ ╹ ╹ ┗━┛┗━╸
version 2.8.0

Loading module Cryptol
Loading module AES
Loading module cbc
cryptol: You have encountered a bug in Cryptol's implementation.
*** Please create an issue at https://github.com/GaloisInc/cryptol/issues

%< ---------------------------------------------------
Revision: UNKNOWN
Branch: UNKNOWN
Location: Renamer
Message: fixity problem for type operators
TInfix (TInfix (TNum 0) (Located {srcRange = Range {from = Position {line = 21, col = 45}, to = Position {line = 21, col = 46}, source = "./cbc-steal.cry"}, thing = UnQual (Ident True "<")}) (Fixity {fAssoc = NonAssoc, fLevel = 30}) (TLocated (TUser (UnQual (Ident False "r")) []) (Range {from = Position {line = 21, col = 47}, to = Position {line = 21, col = 48}, source = "./cbc-steal.cry"}))) (Located {srcRange = Range {from = Position {line = 21, col = 49}, to = Position {line = 21, col = 51}, source = "./cbc-steal.cry"}, thing = UnQual (Ident True "<=")}) (Fixity {fAssoc = NonAssoc, fLevel = 30}) (TLocated (TUser (UnQual (Ident False "b")) []) (Range {from = Position {line = 21, col = 52}, to = Position {line = 21, col = 53}, source = "./cbc-steal.cry"}))
CallStack (from HasCallStack):
panic, called at src/Cryptol/Utils/Panic.hs:21:9 in cryptol-2.8.0-CNGuMszJOXX2THCqGgAi4I:Cryptol.Utils.Panic
panic, called at src/Cryptol/ModuleSystem/Renamer.hs:642:18 in cryptol-2.8.0-CNGuMszJOXX2THCqGgAi4I:Cryptol.ModuleSystem.Renamer
%< ---------------------------------------------------

$

@brianhuffman
Copy link
Contributor

This looks like a duplicate of #614. The problem is the 0 < r <= b in the constraints of cbcStealEnc. We don't support combining < and <= this way, so this should result in a parse error. The bug is that we crash with a panic instead of giving a reasonable error message.

@brianhuffman
Copy link
Contributor

For reference, the recommended workaround is to write 0 < r, r <= b instead of 0 < r <= b in the type constraints.

Closing as duplicate of #614.

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