From 751ffdba4b1368d9213a8b6900556a37f6fe7810 Mon Sep 17 00:00:00 2001 From: widmogrod Date: Sat, 13 Jul 2024 23:21:36 +0200 Subject: [PATCH] x/generator: mkmatch with has bigger tolerance --- x/generators/mkmatch_builder.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/generators/mkmatch_builder.go b/x/generators/mkmatch_builder.go index 5d69f2c6..f86fb446 100644 --- a/x/generators/mkmatch_builder.go +++ b/x/generators/mkmatch_builder.go @@ -168,8 +168,8 @@ func (b *MkMatchBuilder) AddCase(name string, inputs ...string) error { return fmt.Errorf("match.AddCase is empty; case name: %s", name) } - if len(inputs) != len(b.inputTypes) { - return fmt.Errorf("match.AddCase function must have same number of arguments as inputs; case name: %s", name) + if len(inputs) > len(b.inputTypes) { + return fmt.Errorf("match.AddCase function must have at least same number of arguments as number of type params; case name: %s", name) } // check if there are no duplicates in other cases