From 30d5db9bced1af1a799875f5d8706deafeabdda3 Mon Sep 17 00:00:00 2001 From: Vic Nightfall Date: Fri, 8 Nov 2024 21:47:56 +0100 Subject: [PATCH] Better error message --- src/typechecking.pr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/typechecking.pr b/src/typechecking.pr index 49325b9..6d82619 100644 --- a/src/typechecking.pr +++ b/src/typechecking.pr @@ -5835,7 +5835,7 @@ def walk_MemberAccess(node: &parser::Node, state: &State) { @left = new_left if not walk_MemberAccess_ucs(node, state) { - errors::errorn(node, "Unknown field `", last_ident_to_str(right), "`") + errors::errorn(node, "Unknown field `", last_ident_to_str(right), "` on type ", debug::type_to_str(left.tpe)) } return } @@ -5856,7 +5856,7 @@ def walk_MemberAccess_aggregate(node: &parser::Node, ucs: bool, state: &State) - if not rtpe { if ucs { if walk_MemberAccess_ucs(node, state) { return true } - errors::errorn(node, "Unknown field `", name, "`") + errors::errorn(node, "Unknown field `", name, "` on type ", debug::type_to_str(left.tpe)) } return false }