diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-06-28 17:15:10 +0300 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2022-06-30 09:57:38 +0200 |
| commit | 6cadac18b8fb1775815fbb3f16f503c5de0e89d0 (patch) | |
| tree | 2b02f39c02b1d0bad95ae2f3ae7db47c0862fa19 /src/Module.zig | |
| parent | 2e7dc5e15192431c64eca458ecfdce3d07b89f69 (diff) | |
| download | zig-6cadac18b8fb1775815fbb3f16f503c5de0e89d0.tar.gz zig-6cadac18b8fb1775815fbb3f16f503c5de0e89d0.zip | |
Sema: improve auto generated union enum name
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index bdf206490d..1f70a44df5 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -503,6 +503,8 @@ pub const Decl = struct { alive: bool, /// Whether the Decl is a `usingnamespace` declaration. is_usingnamespace: bool, + /// If true `name` is already fully qualified. + name_fully_qualified: bool = false, /// Represents the position of the code in the output file. /// This is populated regardless of semantic analysis and code generation. @@ -686,6 +688,9 @@ pub const Decl = struct { pub fn renderFullyQualifiedName(decl: Decl, mod: *Module, writer: anytype) !void { const unqualified_name = mem.sliceTo(decl.name, 0); + if (decl.name_fully_qualified) { + return writer.writeAll(unqualified_name); + } return decl.src_namespace.renderFullyQualifiedName(mod, unqualified_name, writer); } |
