vyper
vyper copied to clipboard
Un-precise Interface Body Check
Version Information
- vyper Version (output of
vyper --version): commit4b4e188ba83d28b5dd6ff66479e7448e5b925030
Issue description
In interface files (.vyi), function bodies should only contain the AST
Ellipsis node (...). However given how the corresponding check is
done, any statement node with a value field containing an Ellipsis
node can be used in place of the Expr AST node.
if len(funcdef.body) != 1 or not isinstance(funcdef.body[0].get("value"), vy_ast.Ellipsis):
raise FunctionDeclarationException(
"function body in an interface can only be `...`!", funcdef
)
POC
For example, compiling a contract importing the following interface does not raise any exception:
@external
def foo():
log ...