Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Sep 23, 2023
1 parent 8b1cf4e commit f478ce6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/builtins/folding/test_abs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from vyper import ast as vy_ast
from vyper.builtins import functions as vy_fn
from vyper.exceptions import OverflowException
from vyper.exceptions import InvalidType, OverflowException


@pytest.mark.fuzzing
Expand Down Expand Up @@ -35,7 +35,7 @@ def test_abs_upper_bound_folding(get_contract, a):
def foo(a: int256) -> int256:
return abs({a})
"""
with pytest.raises(OverflowException):
with pytest.raises(InvalidType):
get_contract(source)


Expand Down
4 changes: 2 additions & 2 deletions vyper/semantics/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _failwith(type_name):

if isinstance(node, vy_ast.Tuple):
tuple_t = namespace["$TupleT"]
return tuple_t.from_annotation(node)
return tuple_t.from_annotation(node, namespace._constants)

if isinstance(node, vy_ast.Subscript):
# ex. HashMap, DynArray, Bytes, static arrays
Expand All @@ -127,7 +127,7 @@ def _failwith(type_name):
# cases where the object in the namespace is an uninstantiated
# type object, ex. Bytestring or DynArray (with no length provided).
# call from_annotation to produce a better error message.
typ_.from_annotation(node)
typ_.from_annotation(node, namespace._constants)

return typ_

Expand Down

0 comments on commit f478ce6

Please sign in to comment.