view tests/mini/classes13_bug239.d @ 1351:8d501abecd24

Initial (but disabled) fix for ticket #294 , the actual part that fixes the bug is in a #if 0 block as I'm afraid it will cause regressions. I'm most likely not going to be around tonight, and maybe not tomorrow as well, so I'm pushing it in case someone wants to run some serious testing/investigate the problem noted in llvmhelpers.cpp : realignOffset .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Thu, 14 May 2009 17:20:17 +0200
parents 9d308feaec27
children
line wrap: on
line source

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

class A {
    bool Afoo = false;
    void foo() { Afoo = true; }
}

class B : A {}

class C : B {
    bool Cfoo = false;
    void foo() { Cfoo = true; }
}

void main()
{
        scope c1 = new C();
        c1.foo();
	assert(c1.Cfoo && !c1.Afoo);
	
	scope c2 = new C();
	c2.B.foo();
	assert(!c2.Cfoo && c2.Afoo);

	scope c3 = new C();
	c3.A.foo();
	assert(!c3.Cfoo && c3.Afoo);
}