Bug 21774 – "formatException is not constant" instead of "static assert error"
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-03-27T09:47:45Z
Last change time
2021-05-13T05:21:39Z
Assigned to
No Owner
Creator
Berni44
Comments
Comment #0 by bugzilla — 2021-03-27T09:47:45Z
Analysing issue 17381 I found out, that the error message changed:
import std.format : format;
import std.stdio : writeln;
void main()
{
writeln(format!"%s"(1, 2));
}
From 2.074.1 until 2.088.1 it was `Error: static assert "Orphan format arguments: args[1..2]"`
Since then it is `Error: expression `FormatException("Orphan format arguments: args[1..2]", "/home/D/Repo/dmd/generated/linux/release/64/../../../../../phobos/std/format/package.d", 1880LU, null, null, 0u)` is not constant`
which is still a compile time error, but the wrong one.
Comment #1 by moonlightsentinel — 2021-03-27T12:59:20Z