← Back to index
|
Original Bugzilla link
Bug 23956 – [REG2.099.0] Can't decide between const and non-const overload with lambda
Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-06-02T15:59:40Z
Last change time
2024-12-13T19:29:25Z
Keywords
diagnostic, rejects-valid
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#18172 →
Comments
Comment #0
by dlang-bugzilla — 2023-06-02T15:59:40Z
//////////////////////// test.d //////////////////////// struct S { void fun(scope void delegate( int [])) {} void fun(scope void delegate(const(int)[])) const {} } unittest { S s; s.fun((arr) {}); } //////////////////////////////////////////////////////// Compiler says: test.d(10): Error: `test.S.fun` called with argument types `(void)` matches both: test.d(3): `test.S.fun(scope void delegate(int[]) _param_0)` and: test.d(4): `test.S.fun(scope void delegate(const(int)[]) _param_0) const` Looks very similar to issue 23274, may be the same underlying bug.
Comment #1
by dlang-bugzilla — 2023-06-02T16:00:44Z
Introduced in
https://github.com/dlang/dmd/pull/13267
Comment #2
by dlang-bugzilla — 2023-06-02T16:13:22Z
> called with argument types `(void)` Misleading diagnostic, BTW. (Templates have type "void" for some D 0.0x reasons.)
Comment #3
by maxhaton — 2023-06-02T17:00:44Z
Looks like it used to fail prior to 2.075.1 as well
Comment #4
by dlang-bugzilla — 2023-06-02T17:04:01Z
Yes, originally implemented in
https://github.com/dlang/dmd/pull/6731
Comment #5
by robert.schadek — 2024-12-13T19:29:25Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/dmd/issues/18172
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB