diff --git a/vyper/context/types/function.py b/vyper/context/types/function.py index 4fb80d8a6d..7e20be631a 100644 --- a/vyper/context/types/function.py +++ b/vyper/context/types/function.py @@ -7,6 +7,7 @@ from vyper.context.namespace import get_namespace from vyper.context.types.bases import BaseTypeDefinition, DataLocation from vyper.context.types.indexable.sequence import TupleDefinition +from vyper.context.types.meta.struct import StructDefinition from vyper.context.types.utils import ( StringEnum, check_constant, @@ -290,6 +291,11 @@ def from_FunctionDef( type_definition = get_type_from_annotation( arg.annotation, location=DataLocation.CALLDATA, is_immutable=True ) + if isinstance(type_definition, StructDefinition) and type_definition.is_dynamic_size: + raise ArgumentException( + "Struct with dynamically sized data cannot be used as a function input", arg + ) + if value is not None: if not check_constant(value): raise StateAccessViolation(