diff options
| author | Michael Dusan <michael.dusan@gmail.com> | 2019-10-09 14:46:12 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-10-09 17:36:13 -0400 |
| commit | 42f2814d9acc014c84034468b2923195aa547ce1 (patch) | |
| tree | 0825a836f09dbc1de025dda44929cef9419869a8 /src/ir.cpp | |
| parent | e0ab685467567f6da02be865654a2c4dc5f8c3a9 (diff) | |
| download | zig-42f2814d9acc014c84034468b2923195aa547ce1.tar.gz zig-42f2814d9acc014c84034468b2923195aa547ce1.zip | |
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
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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); |
