Skip to content

Error messages - #32

Open
andrewcmyers wants to merge 15 commits into
masterfrom
error-messages
Open

andrewcmyers wants to merge 15 commits into
masterfrom
error-messages

Conversation

@andrewcmyers

Copy link
Copy Markdown
Contributor

To be merged after #31.

A pass over all constraint error messages to make them more intuitive and informative. Also print violated constraints in SCIF terms rather as an encoded string: labels, principals, variables, method signature labels and program points instead of generated names, with => for trust and ⨆/⨅ for joins and meets.

…he leaky semantics, and pick up SHErrLoc's hypothesis-soundness fixes.
exception types are now checked properly and support dependent types.
…ositional for both reads and writes, and receivers can be any variable, member or element.
… by adding a Block node to the AST to replace the previous

fairly ad-hoc 'list of statements' approach.

Also got rid of the endorse statement that was not really suppored anyway.
…nodes;

throw and emit take a name and arguments and share argument checking with calls,
which makes emit sound when a principal argument is not a name.
…ad by struct construction, contract creation, call receivers and call specs.
failures.  Reject return statements that do not match the method's return type
and call options on calls that are not external method calls.
Clearer errors for new.
…pe constraint.

Assume declarations are now assumed rather than checked
Negative regular-check tests must fail with a reported error.
Six tests were repaired.
…, variables, method

signature labels and program points instead of generated names, with => for
trust and ⨆/⨅ for joins and meets.
@andrewcmyers

Copy link
Copy Markdown
Contributor Author
Before:
1. Vault.scif, line 8, column 43: Integrity of the value being assigned must be trusted to allow this assignment.
Constraint violated: s11.Vault.deposit.binL8C43s11<=s11.Vault.balances..lbl.

2. Vault.scif, line 8, column 47: Integrity of right hand expression doesn't flow to value of this binary operation.
Constraint violated: s11.Vault.deposit.amount..lbl<=s11.Vault.deposit.binL8C43s11.

3. Vault.scif, line 7, column 57: Argument amount may be labeled incorrectly.
Constraint violated: s11.Vault.deposit.amount..lbl==s11.Vault.deposit.sender.

After:
1. Vault.scif, line 8, column 43: The assigned value must be trusted at the label of the assignment target.
Constraint violated: operation 8:43 => label(balances).

2. Vault.scif, line 8, column 47: The result of an operation is trusted no more than its right operand.
Constraint violated: label(amount) => operation 8:43.

3. Vault.scif, line 7, column 57: The label of parameter amount may be wrong.
Constraint violated: label(amount) = sender.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant