view run/o/opCast_04_B.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 8a9ce6778db2
children
line wrap: on
line source

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

// @author@	Stewart Gordon <smjg@iname.com>
// @date@	2006-12-13
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=686
// @desc@	[Issue 686] [Regression] opCast of a struct or union is called in nonsensical circumstances

module dstress.run.o.opCast_04_B;

struct Dog {
	int i = 1;
}

struct Cat {
	int i  = 2;

	Dog foo() {
		return Dog.init;
	}

	void bar() {
		Dog d = foo();
		if(d.i != 1){
			assert(0);
		}
	}
}

int main(){
	Cat c;
	c.bar();
	return 0;
}