Is returning void functions inside void functions a feature or an artifact?

user1234 user1234 at 12.de
Tue Aug 3 00:53:43 UTC 2021


On Monday, 2 August 2021 at 14:31:45 UTC, Rekel wrote:
> I recently found one can return function calls to void 
> functions, though I don't remember any documentation mentioning 
> this even though it doesn't seem trivial.
>
> [...]
>
> If this is intended, where could I find this in the docs? I 
> haven't been able to find previous mentions on this, neither on 
> the forum.

You got the answer in another reply but here is a bit of more fun:

```d
void main() {
     return cast(void) 1;
}
```

it's all about the type system and conversions


More information about the Digitalmars-d-learn mailing list