Skip to content

Commit

Permalink
add test for recursive call
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberthirst committed Aug 2, 2024
1 parent cf13ac1 commit 4e44664
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/unit/semantics/analysis/test_cyclic_function_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ def potato():
analyze_module(vyper_module, dummy_input_bundle)


def test_recursive_function_call(dummy_input_bundle):
code = """
@external
def foo():
self.bar()
@internal
def bar():
self.bar()
"""
vyper_module = parse_to_ast(code)
with pytest.raises(CallViolation):
analyze_module(vyper_module, dummy_input_bundle)


def test_global_ann_assign_callable_no_crash(dummy_input_bundle):
code = """
balanceOf: public(HashMap[address, uint256])
Expand Down

0 comments on commit 4e44664

Please sign in to comment.