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

rpc: Fix bug where an empty list is sent back from the server as Unit #1194

Merged
merged 2 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions cryptol-remote-api/python/tests/cryptol/test_SHA256.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ def test_SHA256(self):
expected_h1 = BV(size=256, value=0x248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1)
self.assertEqual(h1, expected_h1)

# ugh, this gives a type error...
# m2 = CryptolLiteral('""')
# j2 = c.call('join', m2).result()
# h2 = c.call('sha256', j2).result()
h2 = c.eval('sha256 (join "")').result()
m2 = CryptolLiteral('""')
j2 = c.call('join', m2).result()
h2 = c.call('sha256', j2).result()
expected_h2 = BV(size=256, value=0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
self.assertEqual(h2, expected_h2)

Expand Down
2 changes: 0 additions & 2 deletions cryptol-remote-api/src/CryptolServer/Data/Expression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,6 @@ readBack ty val =
VInteger i -> pure (IntegerModulo i n)
_ -> mismatchPanic
TVSeq len contents
| len == 0 ->
return Unit
| contents == TVBit
, VWord width wv <- val ->
do BV w v <- asWordVal C.Concrete wv
Expand Down