Skip to content

Commit

Permalink
add test accesing default function in interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberthirst committed Nov 13, 2024
1 parent 272d4d5 commit 6860897
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/functional/syntax/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,3 +598,24 @@ def bar():

with pytest.raises(TypeMismatch):
compiler.compile_code(main, input_bundle=input_bundle)


def test_intrinsic_interfaces_default_function(make_input_bundle, get_contract):
lib1 = """
@external
@payable
def __default__():
pass
"""
main = """
import lib1
@external
def bar():
extcall lib1.__at__(self).__default__()
"""
input_bundle = make_input_bundle({"lib1.vy": lib1})

with pytest.raises(Exception):
compiler.compile_code(main, input_bundle=input_bundle)

0 comments on commit 6860897

Please sign in to comment.