Bug 12856 – template alias should not perform access check

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-06-05T00:46:15Z
Last change time
2020-02-02T00:01:06Z
Assigned to
No Owner
Creator
Martin Nowak

Comments

Comment #0 by code — 2014-06-05T00:46:15Z
cat > bug.d << CODE import bug2; private void foo() {} void main() { bar!foo(); } CODE cat > bug2.d << CODE void bar(alias foo)() { foo(); } CODE ---- dmd -c bug.d ---- bug2.d(1): Error: function bug.foo is not accessible from module bug2 bug.d(4): Error: template instance bug2.bar!(foo) error instantiating ---- The access check should be performed on the template instance argument, but not when using the aliased symbol in the template declaration module. So template alias parameters should behave like public aliases to private symbols.
Comment #1 by code — 2015-04-30T21:18:49Z
*** Issue 13744 has been marked as a duplicate of this issue. ***
Comment #2 by moonlightsentinel — 2020-02-02T00:01:06Z
Works on DMD 2.090