[Issue 23600] New: [std.format.read] formattedRead static asserts with Tuple and compile time format string

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 4 21:32:40 UTC 2023


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

          Issue ID: 23600
           Summary: [std.format.read] formattedRead static asserts with
                    Tuple and compile time format string
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: jlourenco5691 at gmail.com

```d
import std;

void main()
{
    Tuple!(int, float) t;
    "1 2.34".formattedRead!"%d %f"(t);
}
```

This code sample static asserts but correctly runs when passing the format
string at run time. This happens because the format check is performed on the
Tuple type instead of its Types.

--


More information about the Digitalmars-d-bugs mailing list