mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-28 01:23:14 +01:00
Fixed non-static struct initializers.
This commit is contained in:
13
tests/mini/structinit3.d
Normal file
13
tests/mini/structinit3.d
Normal file
@@ -0,0 +1,13 @@
|
||||
struct S {
|
||||
int a; int b; int c; int d = 7;
|
||||
}
|
||||
void test(int i) {
|
||||
S s = { 1, i }; // q.a = 1, q.b = i, q.c = 0, q.d = 7
|
||||
assert(s.a == 1);
|
||||
assert(s.b == i);
|
||||
assert(s.c == 0); // line 8
|
||||
assert(s.d == 7);
|
||||
}
|
||||
void main() {
|
||||
test(42);
|
||||
}
|
||||
Reference in New Issue
Block a user