Bug 21171 – Undefined identifier when alias inside static if.

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-08-17T20:41:27Z
Last change time
2024-12-13T19:11:06Z
Assigned to
No Owner
Creator
Iain Buclaw
Depends on
17883
See also
https://issues.dlang.org/show_bug.cgi?id=20905
Moved to GitHub: dmd#17982 →

Comments

Comment #0 by ibuclaw — 2020-08-17T20:41:27Z
Reduced test. globals.d --- import identifier; static if (0) { } else { alias Uint64 = ulong; alias Int64 = long; } alias sinteger_t = Int64; alias uinteger_t = Uint64; identifier.d --- import globals; struct Token { union { sinteger_t intvalue; uinteger_t unsvalue; } } ---
Comment #1 by ibuclaw — 2020-08-18T06:59:08Z
Don't even need to have it in two separate sources. --- struct Token { union { sinteger_t intvalue; uinteger_t unsvalue; } } static if (0) { } else { alias Uint64 = ulong; alias Int64 = long; } alias sinteger_t = Int64; alias uinteger_t = Uint64;
Comment #2 by ibuclaw — 2020-08-18T07:03:10Z
I thought I recognized the problem. It's likely a duplicate of issue 17883, which I encountered a few years back.
Comment #3 by robert.schadek — 2024-12-13T19:11:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17982 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB