Uncallable delegates

Timon Gehr timon.gehr at gmx.ch
Fri May 15 02:36:12 UTC 2026


On 5/15/26 04:23, Walter Bright wrote:
> On 5/14/2026 2:55 PM, Timon Gehr wrote:
>> FWIW, I am convinced that Dukc has the right idea about delegate 
>> typing, and the proposed change certainly improves things. Though I 
>> guess the unsound `pure` factory function interaction will remain 
>> intact with the DIP as written. (Which is partially my bad, I did not 
>> consider the potential convertibility from mutable to `immutable` when 
>> deriving the soundness condition in the idea thread.)
> 
> I am skeptical that this proposed behavior does not match how overrides 
> in classes work.

Why would the callability check match the overriding behavior?

The callability check should match the callability check.

```d
class C{
     void foo(){}
}

void main(){
     const c = new C;
     c.foo(); // error
}
```

Specifically which proposed behavior are you not able to explain in 
terms of classes?


More information about the dip.development mailing list