[Issue 21774] New: formatException is not constant instead of static assert error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 27 09:47:45 UTC 2021


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 at puremagic.com
          Reporter: bugzilla at 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.

--


More information about the Digitalmars-d-bugs mailing list