[Issue 23592] New: [REG2.095] deprecation on calling aliased private imported function without parens
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Dec 30 16:28:59 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23592
Issue ID: 23592
Summary: [REG2.095] deprecation on calling aliased private
imported function without parens
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: johanengelen at weka.io
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;
}
```
--
More information about the Digitalmars-d-bugs
mailing list