Skip to content

Commit 4e44664

Browse files
committed
add test for recursive call
1 parent cf13ac1 commit 4e44664

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/unit/semantics/analysis/test_cyclic_function_calls.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ def potato():
5454
analyze_module(vyper_module, dummy_input_bundle)
5555

5656

57+
def test_recursive_function_call(dummy_input_bundle):
58+
code = """
59+
@external
60+
def foo():
61+
self.bar()
62+
63+
@internal
64+
def bar():
65+
self.bar()
66+
"""
67+
vyper_module = parse_to_ast(code)
68+
with pytest.raises(CallViolation):
69+
analyze_module(vyper_module, dummy_input_bundle)
70+
71+
5772
def test_global_ann_assign_callable_no_crash(dummy_input_bundle):
5873
code = """
5974
balanceOf: public(HashMap[address, uint256])

0 commit comments

Comments
 (0)