[Issue 24334] parameter name is ignored in invocation of struct constructor with default values

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 12 01:30:55 UTC 2024


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

--- Comment #1 from Jim Balter <jim at balter.name> ---
P.S. The default constructor works correctly:

struct Foo
{
  int a, b = 2, c = 3;
}

void main()
{
  auto foo = Foo(1, c: 99);
  imported!"std.stdio".writefln!"a=%s b=%s c=%s"(foo.a, foo.b, foo.c);

}

output: a=1 b=2 c=99

--


More information about the Digitalmars-d-bugs mailing list