This repository was archived by the owner on Jan 9, 2026. It is now read-only.
Conversation
jwiegley
previously approved these changes
May 10, 2023
jwiegley
reviewed
May 10, 2023
src-tool/Pact/Analyze/Translate.hs
Outdated
| -- rs (2023-05-10): Note, we handle the empty list properly (see #1182) | ||
| -- as the element type is otherwise inferred as `Any`. | ||
| AST_List node [] -> translateType node >>= \case | ||
| EType retTy -> case retTy of |
Contributor
There was a problem hiding this comment.
Why is it called retTy here? What is node at this point?
Member
Author
There was a problem hiding this comment.
retTy is the return type of the translation step, i.e. SList SStr. I will change it to listTy.
The node is of type Node from the Typecheck module, see here. For the particular example above, its TyList {_tyListType = TyPrim TyString}.
Need answer to a question first, I realized
imalsogreg
reviewed
May 10, 2023
Co-authored-by: Greg Hale <[email protected]>
Member
Author
|
The |
imalsogreg
reviewed
May 12, 2023
| |] | ||
| "Vacuous property encountered!" | ||
|
|
||
| describe "regression #1182" $ do |
Contributor
There was a problem hiding this comment.
May be nice for the description to be self-contained.
imalsogreg
approved these changes
May 12, 2023
emilypi
approved these changes
May 15, 2023
Contributor
emilypi
left a comment
There was a problem hiding this comment.
LGTM thank you for the regression.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1182
Prior this PR, the following code
ended in a execution error (Z3 error):
The reason for this behavior is the way we handle the empty list inside
mkLiteralList, which returns a list literal of typeAnyfor the empty list.With the proposed changes, the verification passes as expected:
PR checklist:
cabal run tests. If they pass locally, docs are generated.pact -t), make sure pact-lsp is in sync.Additionally, please justify why you should or should not do the following: