digitalmars.D.bugs - [Issue 15974] New: Spurious error: argument to mixin must be a
- via Digitalmars-d-bugs (33/33) Apr 29 2016 https://issues.dlang.org/show_bug.cgi?id=15974
https://issues.dlang.org/show_bug.cgi?id=15974 Issue ID: 15974 Summary: Spurious error: argument to mixin must be a string, not (expression()) of type string Product: D Version: D2 Hardware: x86 OS: Mac OS X Status: NEW Severity: trivial Priority: P1 Component: dmd Assignee: nobody puremagic.com Reporter: iamthewilsonator hotmail.com DMD64 D Compiler v2.070-devel-5123284 alias allDeviceFns = AliasSeq!("vkCreateSampler"); void loadDeviceFns(VkDevice d) { enum allFns = [allDeviceFns]; foreach(f;allFns) { mixin("%s = cast(typeof(%s)vkGetDeviceProcAddr(d,toStringz(\"%s\"))".format(f,f,f)); } } Gives two errors: vk.d(1576): Error: variable f cannot be read at compile time vk.d(1576): called from here: format("%s = cast(typeof(%s)vkGetDeviceProcAddr(d,toStringz(\"%s\"))", f, f, f) vk.d(1576): Error: argument to mixin must be a string, not (format("%s = cast(typeof(%s)vkGetDeviceProcAddr(d,toStringz(\"%s\"))", f, f, f)) of type string --
Apr 29 2016