Skip to content

Commit

Permalink
fix: use repr for literal validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx authored and achidlow committed Mar 22, 2024
1 parent a1a8f95 commit 2d0feee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/puya/awst/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def accept(self, visitor: StatementVisitor[T]) -> T:

def _validate_literal(value: object, wtype: WType, source_location: SourceLocation) -> None:
if not wtype.is_valid_literal(value):
raise CodeError(f"Invalid {wtype} value: {value}", source_location)
raise CodeError(f"Invalid {wtype} value: {value!r}", source_location)


def literal_validator(wtype: WType) -> t.Callable[[Node, object, t.Any], None]:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_expected_output/itxn.test
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def wrong_arg_type1() -> None:

@subroutine
def wrong_arg_type2() -> None:
arc4.abi_call(Client.foo, "") ## E: Invalid puyapy.arc4.UInt64 value:
arc4.abi_call(Client.foo, "") ## E: Invalid puyapy.arc4.UInt64 value: ''

@subroutine
def wrong_arg_type3() -> None:
Expand Down

0 comments on commit 2d0feee

Please sign in to comment.