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
Digger blames this commit: commit 01effdd82273934ab9d82b7b4af283b28d9131f7 Author: Viktor <[email protected]> Date: Thu Jul 11 12:32:21 2019 +0300 dmd: Improve template constraint error messages (#9715) Improve template constraint error messages merged-on-behalf-of: Razvan Nitu <[email protected]>
Comment #2 by bugzilla — 2021-05-13T05:21:39Z