Skip to content

Commit

Permalink
Fix issue 14041 - Refused writeln of a fixed size array of chars
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Jan 31, 2015
1 parent 71e3ecf commit 6a3cd27
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion std/stdio.d
Expand Up @@ -2915,7 +2915,15 @@ void writeln(T...)(T args)

// Specialization for strings - a very frequent case
auto w = .trustedStdout.lockingTextWriter();
w.put(args[0]);

static if (isStaticArray!(typeof(args[0])))
{
w.put(args[0][]);
}
else
{
w.put(args[0]);
}
w.put('\n');
}
else
Expand All @@ -2935,6 +2943,13 @@ unittest
// bug 8040
if (false) writeln(null);
if (false) writeln(">", null, "<");

// Bugzilla 14041
if (false)
{
char[8] a;
writeln(a);
}
}

unittest
Expand Down

0 comments on commit 6a3cd27

Please sign in to comment.