1 2 3 /******************************************/ 4 5 struct Foo 6 { 7 int v; 8 barFoo9 int bar(int value) { return v = value + 2; } barFoo10 int bar() { return 73; } 11 } 12 test1()13int test1() 14 { 15 Foo f; 16 int i; 17 18 i = (f.bar = 6); 19 assert(i == 8); 20 assert(f.v == 8); 21 22 i = f.bar; 23 assert(i == 73); 24 25 return 0; 26 } 27 28 /******************************************/ 29 // 6259 30 31 struct S6259 32 { 33 private int m_prop; propS625934 ref const(int) prop() { return m_prop; } propS625935 void prop(int v) { m_prop = v; } 36 } 37 test6259()38void test6259() 39 { 40 S6259 s; 41 s.prop = 1; 42 } 43 44 /******************************************/ 45 main()46void main() 47 { 48 test1(); 49 test6259(); 50 } 51