Mercurial > projects > dstress
view run/o/opCast_04_A.d @ 1597:8b9d4d2f925a
Fix typos in complex tests. See D bug 614.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 09 Sep 2008 16:53:58 +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_A; struct Dog { int i = 1; Cat opCast() { return Cat.init; } } 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; }