www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - incomplete mixin expression

reply Andrey <saasecondbox yandex.ru> writes:
 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"?
Apr 24 2019
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Wednesday, 24 April 2019 at 17:22:42 UTC, Andrey wrote:
     alias Qwerty = Alias!(mixin("AliasSeq!(" ~ args ~ ");"));
 }
the inner ; is inappropriate there fixing that might help
Apr 24 2019