Bug 23592 – [REG2.095] deprecation on calling aliased private imported function without parens
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-12-30T16:28:59Z
Last change time
2022-12-30T18:57:55Z
Keywords
industry, rejects-valid
Assigned to
No Owner
Creator
johanengelen
Comments
Comment #0 by johanengelen — 2022-12-30T16:28:59Z
Testcase consists of two files, a.d and b.d.
Compilation `dmd -de a.d -c -o-` gives the message since 2.095:
```
a.d(4): Deprecation: Function b.C.template_function!int.template_function of type pure nothrow @nogc @safe void() is not accessible from module a
```
The deprecation message is gone when calling _with_ parens: `c.foo()`.
Testcase, file a.d:
```
import b;
void foo(C c) {
c.foo;
// c.foo(); // with parens it works without deprecation :-)
}
```
Testcase, file b.d:
```
class C {
private void template_function(T)() {}
alias foo = template_function!int;
}
```