Bug 19536 – Cannot access private template argument

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-01-01T14:18:04Z
Last change time
2024-12-13T19:01:49Z
Assigned to
No Owner
Creator
Victor Porton
Moved to GitHub: dmd#19522 →

Comments

Comment #0 by porton — 2019-01-01T14:18:04Z
Originally appeared in https://stackoverflow.com/q/53982974/856090 //handled_record.d: module handled_record; template CObjects(alias destructor) { void f() { destructor(); } } //world.d: module world; import handled_record; private void free() { } alias objects = CObjects!(free); Compiling: $ dmd -c *.d handled_record.d(5): Error: function world.free is not accessible from module handled_record world.d(7): Error: template instance `handled_record.CObjects!(free)` error instantiating The error disappears if I remove private keyword. Is it a compiler bug? (In my understanding the alias symbol passed to a template should be accessible by the template because it is explicitly passed to the template, even if it is private.)
Comment #1 by robert.schadek — 2024-12-13T19:01:49Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19522 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB