-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement
substitute_error_message_attribute_references
(#689)
* Add flow_tracking_data to Attribute * Start substitute_error_message_references method * First draft * Finish first draft * Remove duplicated error_attr management * Fix string format * Fix invalid reference string + filter out ap-based references * Copy get_maybe_relocatable_from_reference from PR 687 * Filter out complex cairo types * Clippy * Add tests for ap-based references in error attribute messages * Add tests for complex references in error attribute messages * Start changelog entry * Fix eof * Add changelog entry * Fix test * Update changelog * Fix chanhgelog * Fix chanhgelog * Remove debug print * Simplify test Co-authored-by: Juan Rigada <62958725+Jrigada@users.noreply.github.com>
- Loading branch information
Showing
14 changed files
with
318 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
%builtins range_check | ||
from starkware.cairo.common.math import assert_le | ||
|
||
struct Cat { | ||
paws: felt, | ||
lives: felt, | ||
} | ||
|
||
func main{range_check_ptr}() { | ||
alloc_locals; | ||
local cat: Cat = Cat(2, 10); | ||
with_attr error_message("Cats cannot have more than nine lives: {cat}") { | ||
assert_le(cat.lives, 9); | ||
} | ||
return(); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
func main() { | ||
tempvar x = 3; | ||
with_attr error_message("SafeUint256: addition overflow: {x}") { | ||
assert x = 2; | ||
} | ||
return(); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.