The below fails to compile:
```
void main() {
S s;
f(s, (S x) {});
}
immutable struct S {}
void f(T)(const T x, scope void delegate(const T) cb) {
cb(x);
}
```
The error is:
```
a.d(3): Error: none of the overloads of template `a.f` are callable using argument types `!()(immutable(S), void function(immutable(S) x) pure nothrow @nogc @safe)`
a.d(8): Candidate is: `f(T)(const T x, scope void delegate(const(T)) cb)`
```
It works if I specify `f!S`. It also works if I remove `immutable` from the struct definition and change the call to `f(s, (const S x) {});`.
Comment #1 by robert.schadek — 2024-12-13T19:26:14Z