www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23600] New: [std.format.read] formattedRead static asserts

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

--
Jan 04 2023