Mercurial > projects > ldc
comparison test/interface1.d @ 113:27b9f749d9fe trunk
[svn r117] Initial working implementation of interfaces.
Groundwork for all the different types of class/interface casts laid out.
author | lindquist |
---|---|
date | Sat, 24 Nov 2007 06:33:00 +0100 |
parents | |
children | 44a95ac7368a |
comparison
equal
deleted
inserted
replaced
112:368547b1cbe6 | 113:27b9f749d9fe |
---|---|
1 module interface1; | |
2 | |
3 interface Inter | |
4 { | |
5 void func(); | |
6 } | |
7 | |
8 class Class : Inter | |
9 { | |
10 override void func() | |
11 { | |
12 printf("hello world\n"); | |
13 } | |
14 } | |
15 | |
16 void main() | |
17 { | |
18 scope c = new Class; | |
19 c.func(); | |
20 Inter i = c; | |
21 i.func(); | |
22 } |