Skip to content

Commit

Permalink
Better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorious3 committed Nov 8, 2024
1 parent 11d07ce commit 30d5db9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typechecking.pr
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit 30d5db9

Please sign in to comment.