D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22794 - Compile-time format validation gives unhelpful error on too many arguments
Summary: Compile-time format validation gives unhelpful error on too many arguments
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-20 10:07 UTC by JR
Modified: 2022-12-17 16:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description JR 2022-02-20 10:07:05 UTC
Manjaro/Arch x86_&4, dmd 2.098.1.

```d
import std.stdio;

void main()
{
    writefln!"%s"("a", "b");
}
```

>/dlang/dmd/linux/bin64/../../src/phobos/std/stdio.d(4442): Error: no property `msg` for type `string`
>/dlang/dmd/linux/bin64/../../src/phobos/std/stdio.d(4442): Error: static assert:  __error
>onlineapp.d(4):        instantiated from here: `writefln!("%s", string, string)`

https://run.dlang.io/is/fQ9GtQ
Comment 1 Nick Treleaven 2022-09-05 17:25:22 UTC
run.dlang.io gives:

/dlang/dmd/linux/bin64/../../src/phobos/std/stdio.d(4432): Error: static assert:  "Orphan format arguments: args[1..2]"
onlineapp.d(5):        instantiated from here: `writefln!("%s", string, string)`

I also get that with dmd v2.100.2-beta.1-dirty.
Comment 2 Nick Treleaven 2022-12-17 16:33:49 UTC
Fixed in 2.099.1.