On Friday, 11 December 2020 at 11:25:22 UTC, Andrey Zherikov wrote:
Here is the example:
    alias f1 = (string  ) {}; f1(int   .init);
    alias f2 = (string s) {}; f2(int   .init);
    alias f3 = (int     ) {}; f3(string.init);
    alias f4 = (int i   ) {}; f4(string.init);

"f1" case compiles successfully and all others are not (error is "is not callable using argument types").

Question is why does f1 case compile?

Furthermore even these do compile:
    f1(float.init);

    struct S{}
    f1(S.init);



alias f1 = (string  ) {}

"string" isn't type, but name of variable with generic type:

alias f1 = (/*auto type*/ string) {}

Reply via email to