Mercurial > projects > ldc
view tests/mini/interface3.d @ 1169:2bff538fa3b9
Automated merge with http://hg.dsource.org/projects/ldc
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 29 Mar 2009 11:44:32 +0200 |
parents | 340acf1535d0 |
children |
line wrap: on
line source
module interface3; extern(C) int printf(char*,...); interface I { void func(); } class C : I { int i = 42; override void func() { printf("hello %d from %p\n", i, this); i++; } } void main() { auto c = new C; {c.func();} { I i = c; {i.func();} } {printf("final %d\n", c.i);} {assert(c.i == 44);} }