From 27011f385b504fb6f81985f60e337b603a0259e6 Mon Sep 17 00:00:00 2001 From: David Mak Date: Fri, 2 Feb 2024 12:49:21 +0800 Subject: [PATCH] core: Add location to non-primitive value return error --- nac3core/src/typecheck/function_check.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nac3core/src/typecheck/function_check.rs b/nac3core/src/typecheck/function_check.rs index 21576e0..25131bc 100644 --- a/nac3core/src/typecheck/function_check.rs +++ b/nac3core/src/typecheck/function_check.rs @@ -337,8 +337,9 @@ impl<'a> Inferencer<'a> { if !self.check_return_value_ty(ret_ty) { return Err(HashSet::from([ format!( - "return value of type {} must be a primitive of a tuple of primitives", + "return value of type {} must be a primitive of a tuple of primitives at {:?}", self.unifier.stringify(ret_ty), + value.location, ), ])) }