dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Wrong location for "not a member" error when constructing a struct literal

Open VPanteleev-S7 opened this issue 6 months ago • 1 comments

struct S { int x; }

void test() {
	auto s = S(
		y:
		1
	);
}

Output:

test.d(6): Error: `y` is not a member of `S`

The error is reported on the line with the value (1), but the undefined identifier in question is actually on the previous line.

VPanteleev-S7 avatar Apr 12 '25 15:04 VPanteleev-S7