From 42fbe8e383bbe454e87dc2c59d8cd3cca67c42f9 Mon Sep 17 00:00:00 2001 From: ychenfo Date: Sat, 5 Mar 2022 03:59:45 +0800 Subject: [PATCH] nac3core: fix err msg of too many args --- nac3core/src/typecheck/typedef/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nac3core/src/typecheck/typedef/mod.rs b/nac3core/src/typecheck/typedef/mod.rs index 6246dc217..b58c160bd 100644 --- a/nac3core/src/typecheck/typedef/mod.rs +++ b/nac3core/src/typecheck/typedef/mod.rs @@ -429,7 +429,10 @@ impl Unifier { if signature.args.len() <= i { self.restore_snapshot(); return Err(TypeError::new( - TypeErrorKind::TooManyArguments { expected: signature.args.len(), got: i }, + TypeErrorKind::TooManyArguments { + expected: signature.args.len(), + got: posargs.len() + kwargs.len(), + }, *loc, )); }