www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21774] New: formatException is not constant instead of static

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

          Issue ID: 21774
           Summary: formatException is not constant instead of static
                    assert error
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: bugzilla bernis-buecher.de

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. --
Mar 27 2021