Bug 21670 – [REG 2.095] Public alias to private function triggers a deprecaton when called without parens

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-01T00:39:56Z
Last change time
2024-12-13T19:14:55Z
Keywords
industry, rejects-valid
Assigned to
No Owner
Creator
Mathias LANG
Moved to GitHub: dmd#19878 →

Comments

Comment #0 by pro.mathias.lang — 2021-03-01T00:39:56Z
This triggers a deprecation n v2.095.1: ``` // File: a.d module a; private string csiSeq (string value) () { return value; } public alias csiSeq!("SEQ") up; // File: b.d module b; import a; void main () { string s = up; } ``` Running `~/dlang/dmd-2.094.0/osx/bin/dmd -i b.d` pass without message. Using v2.095.1 however: ``` b.d(5): Deprecation: Function a.csiSeq!"SEQ".csiSeq of type pure nothrow @nogc @safe string() is not accessible from module b ```
Comment #1 by razvan.nitu1305 — 2021-03-03T14:34:04Z
Comment #2 by ibuclaw — 2022-12-30T18:57:55Z
*** Issue 23592 has been marked as a duplicate of this issue. ***
Comment #3 by ibuclaw — 2022-12-30T18:59:02Z
(In reply to Mathias LANG from comment #0) > void main () > { > string s = up; > } As pointed out in issue 23592, `s = up();` works around the issue.
Comment #4 by robert.schadek — 2024-12-13T19:14:55Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19878 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB