incomplete mixin expression

Andrey saasecondbox at yandex.ru
Wed Apr 24 17:22:42 UTC 2019


> enum Qaz : wstring
> {
>     One = "один"
> }
>
> template Qwerty(Values...)
> {
>     enum text = "Values[%d]";
>     enum args = iota(Values.length).map!(value => 
> format!text(value)).join(',');
> 
>     pragma(msg, args);
> 
>     alias Qwerty = Alias!(mixin("AliasSeq!(" ~ args ~ ");"));
> }
> 
> void main()
> {
>     Qwerty!(10, Qaz.One, "qwerty").writeln;
> }

Output:
Values[0],Values[1],Values[2]
onlineapp.d(44): Error: incomplete mixin expression 
AliasSeq!(Values[0],Values[1],Values[2]);
onlineapp.d(54): Error: template instance 
`onlineapp.toUnderlyingType!(10, 
"\x3e\x04\x34\x04\x38\x04\x3d\x04", "qwerty")` error instantiating

Why mixin is "incomplete"?


More information about the Digitalmars-d-learn mailing list