Sema: fix printing of inferred error set of generic fn

Closes #19332
This commit is contained in:
Veikka Tuominen
2024-03-17 13:21:43 +02:00
parent 294f51814f
commit f983adfc10
4 changed files with 24 additions and 4 deletions

View File

@@ -1897,8 +1897,11 @@ pub const SrcLoc = struct {
const parent_node = src_loc.declRelativeToNodeIndex(node_off);
var buf: [2]Ast.Node.Index = undefined;
const full = tree.fullArrayInit(&buf, parent_node).?;
return tree.nodeToSpan(full.ast.type_expr);
const type_expr = if (tree.fullArrayInit(&buf, parent_node)) |array_init|
array_init.ast.type_expr
else
tree.fullStructInit(&buf, parent_node).?.ast.type_expr;
return tree.nodeToSpan(type_expr);
},
.node_offset_store_ptr => |node_off| {
const tree = try src_loc.file_scope.getTree(gpa);