Mercurial > projects > ldc
view tests/mini/interface5.d @ 1308:316e9ecfeb7d
Automated merge with http://hg.dsource.org/projects/ldc
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Wed, 06 May 2009 20:29:27 +0200 |
parents | dde9dbae052a |
children |
line wrap: on
line source
module interface5; extern(C) int printf(char*,...); interface I { void func(); } class C : I { int i; void func() { printf("C\n"); i++; } } void main() { C c = new C; c.func(); { I i = c; i.func(); C c2 = cast(C)i; c2.func(); c.func(); assert(c.i == 4); } }