view 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
line wrap: on
line source

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();
}