mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00

* Add named argument parsing * Refactor StructInitializer semantic to make it reusable * Move out `resolveStructLiteralNamedArgs` * Resolve named args in struct literal * Add tests * Check for errors returned by `resolveStructLiteralNamedArgs` * Expand names along with tuples * Update error messages in tests * Convert tabs to spaces in named arg test * Fix style of `resolveStructLiteralNamedArgs` * Clarify 'fixme' comment in expandTuples * Add example to `expandTuples` documentation * Update compiler/src/dmd/initsem.d Co-authored-by: Razvan Nitu <razvan.nitu1305@gmail.com> * Add overlapping initialization supplemental error to Struct Initializer * Improve "too many initializers" error message Co-authored-by: Razvan Nitu <razvan.nitu1305@gmail.com>
21 lines
358 B
D
21 lines
358 B
D
// https://issues.dlang.org/show_bug.cgi?id=22570
|
|
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail22570.d(19): Error: too many initializers for `S` with 1 field
|
|
fail_compilation/fail22570.d(20): Error: too many initializers for `S` with 1 field
|
|
---
|
|
*/
|
|
|
|
struct S
|
|
{
|
|
Object o1;
|
|
}
|
|
|
|
void main() @safe
|
|
{
|
|
S[] s;
|
|
s = [S(null, null)];
|
|
s ~= S(null, null);
|
|
}
|