Thread overview
[Issue 23955] Can't access non-eponymous members in IFTI template
Jun 02, 2023
Vladimir Panteleev
Jun 03, 2023
Vladimir Panteleev
Jun 03, 2023
Vladimir Panteleev
Nov 22, 2023
Paul Backus
June 02, 2023
https://issues.dlang.org/show_bug.cgi?id=23955

--- Comment #1 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
(In reply to Vladimir Panteleev from comment #0)
> Now, we want to make getArr callable with a const S. Attempt #1, add a const overload:
> 
>     void getArr(scope void delegate(int[]) fn) { fn(arr); }
>     void getArr(scope void delegate(const(int)[]) fn) const { fn(arr); }
> 
> Oops, now calling getArr on a mutable object with a lambda causes "matches both" errors.

Oh, actually this is a regression.

https://issues.dlang.org/show_bug.cgi?id=23956

--
June 03, 2023
https://issues.dlang.org/show_bug.cgi?id=23955

--- Comment #2 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
For the above puzzle, the workaround/solution is to declare both a template overload and non-template overloads for the method. The lambdas (function templates) will resolve onto the overload set, and everything else can use the template.

--
June 03, 2023
https://issues.dlang.org/show_bug.cgi?id=23955

--- Comment #3 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Err, however that does not help with const due to the regression linked above.

--
November 22, 2023
https://issues.dlang.org/show_bug.cgi?id=23955

Paul Backus <snarwin+bugzilla@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |snarwin+bugzilla@gmail.com

--- Comment #4 from Paul Backus <snarwin+bugzilla@gmail.com> ---
Seems like this might be related to issue 23292.

--