annotate run/i/in_out_body_12_C.d @ 1320:daef239f37cf

sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
author thomask
date Sun, 31 Dec 2006 19:59:08 +0000
parents 246bfd1f5ef5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1103
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
1 // $HeadURL$
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
2 // $Date$
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
3 // $Author$
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
4
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
5 // @author@ Deewiant <deewiant@gmail.com>
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
6 // @date@ 2006-07-09
1320
daef239f37cf sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents: 1103
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=247
1103
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
8 // @desc@ [Issue 247] Cannot return from nested functions in contracts
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
9
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
10 module dstress.run.i.in_out_body_12_C;
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
11
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
12 int foo(int dummy)
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
13 out(result){
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
14 static int checkParameters(int x) {
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
15 if(x < 0){
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
16 return checkParameters(-x);
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
17 }else{
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
18 return x % 2;
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
19 }
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
20 }
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
21
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
22 assert(checkParameters(result) == 1);
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
23 } body {
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
24 return dummy+1;
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
25 }
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
26
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
27 int main(){
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
28 foo(4);
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
29
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
30 return 0;
246bfd1f5ef5 [Issue 247] Cannot return from nested functions in contracts
thomask
parents:
diff changeset
31 }