From 81e72e1430911b57807ad4056041d48316b39c97 Mon Sep 17 00:00:00 2001 From: Daniel Perez Date: Sat, 3 Aug 2024 19:59:29 +0100 Subject: [PATCH] Fix function that don't typecheck --- CHANGELOG.md | 1 + src/interpreter/functions/function.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eabb878..426b932 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ### Bug fixes * Fix parsing of fix bytes with less than 32 bytes (e.g. bytes4) +* Fix display of functions that don't check argument types ## 0.1.1 (2024-07-30) diff --git a/src/interpreter/functions/function.rs b/src/interpreter/functions/function.rs index d43dc2d..2dc7778 100644 --- a/src/interpreter/functions/function.rs +++ b/src/interpreter/functions/function.rs @@ -36,7 +36,10 @@ impl std::cmp::Eq for Function {} impl fmt::Display for Function { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let variants = self.get_variants(); + let mut variants = self.get_variants(); + if variants.is_empty() { + variants = vec![format!("{}(any... args)", self.def.name())]; + } for (i, variant) in variants.iter().enumerate() { if i > 0 { writeln!(f)?;