Bug 24019 – Public alias to private struct template in struct instantiated in UDA is not visible from module

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-06-27T12:04:09Z
Last change time
2024-12-13T19:29:58Z
Assigned to
No Owner
Creator
FeepingCreature
Moved to GitHub: dmd#18178 →

Comments

Comment #0 by default_357-line — 2023-06-27T12:04:09Z
import_a.d: ``` struct S { public alias A = T; } private struct T() { } ``` test.d: ``` import import_a; @(S.A!()) void main() { } ``` Worked as of 2.102.2, but on master says ``` test.d(4): Error: `import_a.A!().T` is not visible from module `test` ```
Comment #1 by default_357-line — 2023-06-28T07:57:12Z
Hm. I'm not actually convinced this is a _bug_. We have a public alias, but the alias goes to a private template, and we instantiate the template from outside via the alias. The template has a private member... that member is found *via* the alias, but is not itself anywhere marked as public. If we write it out: ``` struct S { public alias A = T; } private template T() { private struct T {} } ... @(S.A!().T) void main() { } ``` It's not at all obvious that this is erroring wrongly.
Comment #2 by robert.schadek — 2024-12-13T19:29:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18178 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB