summaryrefslogtreecommitdiff
path: root/tests/parser-keep-going/member-initializer.vala
blob: 4ab47a26d391120ab73798e16404e76c2d188960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
struct Foo {
    uint x;
    int y;
}

class Bar {
    public string s;
}

void main() {
    var foo = Foo () {
		x = (uint) 23,
		y = 42
    };
    assert (foo.x == 23U);
    assert (foo.y == 42);

    var bar = new Bar () {
		s = "bar"
    };
    assert (bar.s == "bar");
}