view run/w/with_15_A.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents daef239f37cf
children
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	Chris Miller <chris@dprogramming.com>
// @date@	2006-09-06
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=325
// @desc@	[Issue 325] New: Overriding members and overloading with alias causes bogus error messages in with().

module dstress.run.w.with_15_A;

class Base{
	int data;

	void foo(int i){
		data = i;
	}
	int foo(){
		return data;
	}
}

class Derived : Base{
	alias Base.foo foo;
	
	override void foo(int i){
		super.data = 2 * i;
	}
}

int main(){
	Derived d = new Derived();
	with(d){
		foo = 1;
	}

	if(d.foo() != 2){
		assert(0);
	}

	return 0;
}