From 42f2814d9acc014c84034468b2923195aa547ce1 Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Wed, 9 Oct 2019 14:46:12 -0400 Subject: stage1: fix root top-level-struct typename - during diagnostics the string representation for root was empty and now is `(root)` - retrofitted all other namespace-qualified type naming to elide prefixing with root closes #2032 --- src/ir.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index ad5ffcd951..0e6153ebcd 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -7852,8 +7852,8 @@ static Buf *get_anon_type_name(CodeGen *codegen, IrExecutable *exec, const char { if (exec->name) { ZigType *import = get_scope_import(scope); - Buf *namespace_name = buf_create_from_buf(&import->name); - if (buf_len(namespace_name) != 0) buf_append_char(namespace_name, NAMESPACE_SEP_CHAR); + Buf *namespace_name = buf_alloc(); + append_namespace_qualification(codegen, namespace_name, import); buf_append_buf(namespace_name, exec->name); buf_init_from_buf(out_bare_name, exec->name); return namespace_name; @@ -7867,8 +7867,8 @@ static Buf *get_anon_type_name(CodeGen *codegen, IrExecutable *exec, const char return name; } else { ZigType *import = get_scope_import(scope); - Buf *namespace_name = buf_create_from_buf(&import->name); - if (buf_len(namespace_name) != 0) buf_append_char(namespace_name, NAMESPACE_SEP_CHAR); + Buf *namespace_name = buf_alloc(); + append_namespace_qualification(codegen, namespace_name, import); buf_appendf(namespace_name, "%s:%" ZIG_PRI_usize ":%" ZIG_PRI_usize, kind_name, source_node->line + 1, source_node->column + 1); buf_init_from_buf(out_bare_name, namespace_name); -- cgit v1.2.3