Why can I call a function with mismatched parameter type?

Andrey Zherikov andrey.zherikov at gmail.com
Fri Dec 11 11:48:23 UTC 2020


On Friday, 11 December 2020 at 11:36:05 UTC, vit wrote:
> alias f1 = (string  ) {}
>
> "string" isn't type, but name of variable with generic type:
>
> alias f1 = (/*auto type*/ string) {}

This makes it clear, thanks!

Just checked that this fails as expected: alias f1 = 
(immutable(char)[]) {}


More information about the Digitalmars-d-learn mailing list