diff --git a/v2/internal/binding/boundMethod.go b/v2/internal/binding/boundMethod.go index 30b72af9..f6ffdb60 100644 --- a/v2/internal/binding/boundMethod.go +++ b/v2/internal/binding/boundMethod.go @@ -30,6 +30,9 @@ func (b *BoundMethod) OutputCount() int { func (b *BoundMethod) ParseArgs(args []json.RawMessage) ([]interface{}, error) { result := make([]interface{}, b.InputCount()) + if len(args) != b.InputCount() { + return nil, fmt.Errorf("received %d arguments to method '%s', expected %d", len(args), b.Name, b.InputCount()) + } for index, arg := range args { typ := b.Inputs[index].reflectType inputValue := reflect.New(typ).Interface()