[Issue 15993] using mixin to specify 2 arguments for writefln results in unrecognized behavior

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu May 5 21:29:05 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=15993

--- Comment #2 from yosikawa at altalk.com ---
(In reply to Mathias Lang from comment #1)
> That's because it doesn't behaves as you expect it to.
> 
> What's mixed in is an expression, not a tuple. The first value is then
> discarded thanks to the coma operator.
> 
> Corrected code:
> ```
> import std.typetuple;
> import std.stdio;
> 
> string foo() {
>     return `AliasSeq!(123,"foo")`;
> }
> void main() {
>     writefln("%d %s", mixin(foo()));
> }
> ```
> 
> Closing as invalid, as it behaves as expected.

It works. Thanks for correction.

--


More information about the Digitalmars-d-bugs mailing list