summaryrefslogtreecommitdiff
path: root/tests/objects/property-static.vala
blob: e224481089499a63e4925b04cf1b987f6a145678 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class Foo {
	static int _bar;
	static int _baz;

	public static int bar {
		get { assert_not_reached (); }
		set { _bar = value; assert (_bar == 23); }
	}

	public static int baz {
		set { _baz = value; assert (_baz == 42); }
	}

	public static int boo { set; }
}

struct Bar {
	public int foo;

	static int _bar;
	static int _baz;

	public static int bar {
		get { assert_not_reached (); }
		set { _bar = value; assert (_bar == 23); }
	}

	public static int baz {
		set { _baz = value; assert (_baz == 42); }
	}

	public static int boo { set; }
}

void main () {
	Foo.bar = 23;
	Foo.baz = 42;
	Foo.boo = 4711;

	Bar.bar = 23;
	Bar.baz = 42;
	Bar.boo = 4711;
}