From 3e1bf7f9946efe70d452c71494ac77ed39110804 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Wed, 6 Aug 2025 17:05:55 +0300 Subject: Added print, raised level on which UnboundGeneric error is returned --- src/type/display.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/type/display.rs') diff --git a/src/type/display.rs b/src/type/display.rs index 4a9b54a..f859dc3 100644 --- a/src/type/display.rs +++ b/src/type/display.rs @@ -67,8 +67,8 @@ impl fmt::Display for TypeError { /// "invalid argument list: '(1 2 3)'\nexpected: '(Int Int)'\nfound: '(Int Int Int)'".to_string() /// ); /// assert_eq!( - /// UnboundGeneric(String::from("?")).to_string(), - /// "unbound generic type: '?'".to_string() + /// UnboundGeneric(arr(Integer, vt("?")), String::from("?")).to_string(), + /// "unbound generic type in '(Int -> ?)': '?'".to_string() /// ); /// assert_eq!( /// ArgumentsDontMatchGeneric { @@ -80,8 +80,8 @@ impl fmt::Display for TypeError { /// ``` fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - UndefinedVariable(name) => write!(f, "undefined variable: '{}'", name), - UnboundGeneric(name) => write!(f, "unbound generic type: '{}'", name), + UndefinedVariable(name) => write!(f, "undefined variable: '{}'", name), + UnboundGeneric(ty, name) => write!(f, "unbound generic type in '{}': '{}'", ty, name), InvalidOperator { operator, expected, found } => { write!( f, -- cgit v1.2.3