view tangotests/k.d @ 193:aca17e55b7a5 trunk

[svn r209] Fixed: exotic array to pointer casts were broken. Changed: classes now have opaque vtables.
author lindquist
date Mon, 12 May 2008 18:44:11 +0200
parents 44a95ac7368a
children
line wrap: on
line source

interface Inter
{
    int func();
}

extern(C) int printf(char*, ...);

class InterClass : Inter
{
    int func()
    {
        return printf("InterClass.func()\n");
    }
}

alias int delegate() dg_t;

void main()
{
    scope c = new InterClass;

    {
    Inter i = cast(Inter)c;
        {
        dg_t dg = &i.func;
            {
            int j = dg();
            }
        }
    }
}