comparison run/o/opCast_04_B.d @ 1294:8a9ce6778db2

[Issue 686] [Regression] opCast of a struct or union is called in nonsensical circumstances Stewart Gordon <smjg@iname.com> 2006-12-13 http://d.puremagic.com/issues/show_bug.cgi?id=686
author thomask
date Sat, 30 Dec 2006 15:39:26 +0000
parents
children
comparison
equal deleted inserted replaced
1293:744c4ec3e3e3 1294:8a9ce6778db2
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 // @author@ Stewart Gordon <smjg@iname.com>
6 // @date@ 2006-12-13
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=686
8 // @desc@ [Issue 686] [Regression] opCast of a struct or union is called in nonsensical circumstances
9
10 module dstress.run.o.opCast_04_B;
11
12 struct Dog {
13 int i = 1;
14 }
15
16 struct Cat {
17 int i = 2;
18
19 Dog foo() {
20 return Dog.init;
21 }
22
23 void bar() {
24 Dog d = foo();
25 if(d.i != 1){
26 assert(0);
27 }
28 }
29 }
30
31 int main(){
32 Cat c;
33 c.bar();
34 return 0;
35 }