Re: interface inference with delegates/functions

2025-02-05 Thread axricard via Digitalmars-d-learn
On Wednesday, 5 February 2025 at 01:20:07 UTC, Jonathan M Davis wrote: Note that it talks about the "initial inferred return type", whereas your function doesn't have an initial inferred return type, because it fails to compile when determining the return type. So, while the spec doesn't expand

Re: interface inference with delegates/functions

2025-02-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, February 4, 2025 5:53:02 AM MST axricard via Digitalmars-d-learn wrote: > Basically the same question than > https://forum.dlang.org/post/aoltazzfmnztsyatf...@forum.dlang.org > but with functions/delegates and inferred return types: > > ``` D > interface I { > bool check(); >

interface inference with delegates/functions

2025-02-04 Thread axricard via Digitalmars-d-learn
Basically the same question than https://forum.dlang.org/post/aoltazzfmnztsyatf...@forum.dlang.org but with functions/delegates and inferred return types: ``` D interface I { bool check(); } class A : I { bool check() =>true; } class B : I { bool check() =>false; } void