Bug 8868 – overload resolution of &x.g() incorrectly chooses delegate over function pointer

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-22T06:20:51Z
Last change time
2024-12-13T18:01:50Z
Keywords
accepts-invalid, pull
Assigned to
No Owner
Creator
Don
Moved to GitHub: dmd#17559 →

Comments

Comment #0 by clugdbug — 2012-10-22T06:20:51Z
..or vice versa. Reported by kenji in the pull request for bug 8257. https://github.com/D-Programming-Language/dmd/pull/1194 ----- struct S8257 { void g(int n){} // before the static one static int g() { return 6; } } void main() { auto k = &(func()).g; pragma(msg, typeof(k)); // prints void delegate(int n) } It always chooses the first function declaration.
Comment #1 by smjg — 2012-11-04T16:23:54Z
What is 'func'? The code shouldn't compile as written. Otherwise, this looks like a case of issue 52 that the fix doesn't cover.
Comment #2 by k.hara.pg — 2014-04-16T07:35:41Z
Comment #3 by robert.schadek — 2024-12-13T18:01:50Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17559 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB