view tests/mini/vararg7.d @ 834:f466f475b654

Added proper "need 'this' to access member foo" errors instead of "variable foo not resolved" for some cases, added FIXME for the old error! Added a bit more information to the runtime's cyclic dependency detection exception.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 09 Dec 2008 01:56:39 +0100
parents 1bb99290e03a
children
line wrap: on
line source

module tangotests.vararg4;

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

struct S
{
    int i;
}

void func(...)
{
    S* sp = cast(S*)_argptr;
    assert(sp.i == 42);
}

void main()
{
    printf("1st:\n");
    {
    S s = S(42);
    func(s);
    }
    printf("ok\n");

    printf("2nd:\n");
    {
    func(S(42));
    }
    printf("ok\n");
}