mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-20 13:43:13 +01:00
[svn r117] Initial working implementation of interfaces.
Groundwork for all the different types of class/interface casts laid out.
This commit is contained in:
22
test/interface1.d
Normal file
22
test/interface1.d
Normal file
@@ -0,0 +1,22 @@
|
||||
module interface1;
|
||||
|
||||
interface Inter
|
||||
{
|
||||
void func();
|
||||
}
|
||||
|
||||
class Class : Inter
|
||||
{
|
||||
override void func()
|
||||
{
|
||||
printf("hello world\n");
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
scope c = new Class;
|
||||
c.func();
|
||||
Inter i = c;
|
||||
i.func();
|
||||
}
|
||||
Reference in New Issue
Block a user