annotate run/o/odd_bug_04_A.d @ 1535:20d8ee6523e1

updated to DMD-1.013
author thomask
date Mon, 07 May 2007 05:19:57 +0000
parents b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
777
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
1 // $HeadURL$
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
2 // $Date$
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
3 // $Author$
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
4
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
5 // @author@ John Demme <me@teqdruid.com>
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
6 // @date@ 2005-12-05
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 777
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=5755
777
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
8
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
9 module dstress.run.o.odd_bug_04_A;
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
10
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
11 abstract class Container(V) {
1535
20d8ee6523e1 updated to DMD-1.013
thomask
parents: 1489
diff changeset
12 abstract int opApply(int delegate(ref V) dg);
777
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
13 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
14
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
15 abstract class MutableList(V): Container!(V) {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
16 abstract MutableList insertBefore(int i, V item);
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
17
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
18 abstract MutableList append(V item);
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
19 abstract MutableList append(Container!(V) items);
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
20 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
21
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
22 class AbstractMutableList(V): MutableList!(V) {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
23 MutableList!(V) prepend(Container!(V) items) {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
24 foreach(V item; items) {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
25 insertBefore(0, item);
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
26 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
27 return this;
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
28 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
29 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
30
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
31 class CommandLine {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
32 AbstractMutableList!(int) paramList;
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
33 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
34
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
35 int main(){
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
36 test1();
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
37 test2();
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
38 return 0;
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
39 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
40
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
41 void test1(){
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
42 void testBoolParam() {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
43 try {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
44 throw new Exception( "uups" );
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
45 } catch (Exception o) {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
46 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
47 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
48
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
49 testBoolParam();
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
50 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
51
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
52 void test2(){
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
53 void testBoolParam() {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
54 try {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
55 throw new Exception( "uups" );
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
56 } catch (Exception o) {
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
57 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
58 }
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
59
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
60 testBoolParam();
2f10fa84a21b bulk offline commit
thomask
parents:
diff changeset
61 }