blob: 4fd98d3cc553714c2e1c094ca63ae53a90649988 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
/*
TEST_OUTPUT:
---
fail_compilation/fail9414a.d(47): Error: variable fail9414a.C.foo.x cannot modify parameter 'x' in contract
fail_compilation/fail9414a.d(34): Error: variable fail9414a.C.foo.x cannot modify parameter 'x' in contract
fail_compilation/fail9414a.d(35): Error: variable fail9414a.C.foo.__require.bar.y cannot modify parameter 'y' in contract
fail_compilation/fail9414a.d(40): Error: variable fail9414a.C.foo.x cannot modify parameter 'x' in contract
fail_compilation/fail9414a.d(41): Error: variable fail9414a.C.foo.__require.bar.y cannot modify parameter 'y' in contract
fail_compilation/fail9414a.d(42): Error: variable fail9414a.C.foo.__require.bar.s cannot modify result 's' in contract
fail_compilation/fail9414a.d(52): Error: variable fail9414a.C.foo.x cannot modify parameter 'x' in contract
fail_compilation/fail9414a.d(75): Error: variable fail9414a.C.foo.x cannot modify parameter 'x' in contract
fail_compilation/fail9414a.d(76): Error: variable fail9414a.C.foo.__ensure.r cannot modify result 'r' in contract
fail_compilation/fail9414a.d(60): Error: variable fail9414a.C.foo.x cannot modify parameter 'x' in contract
fail_compilation/fail9414a.d(61): Error: variable fail9414a.C.foo.__ensure.r cannot modify result 'r' in contract
fail_compilation/fail9414a.d(62): Error: variable fail9414a.C.foo.__ensure.baz.y cannot modify parameter 'y' in contract
fail_compilation/fail9414a.d(67): Error: variable fail9414a.C.foo.x cannot modify parameter 'x' in contract
fail_compilation/fail9414a.d(68): Error: variable fail9414a.C.foo.__ensure.r cannot modify result 'r' in contract
fail_compilation/fail9414a.d(69): Error: variable fail9414a.C.foo.__ensure.baz.y cannot modify parameter 'y' in contract
fail_compilation/fail9414a.d(70): Error: variable fail9414a.C.foo.__ensure.baz.s cannot modify result 's' in contract
fail_compilation/fail9414a.d(81): Error: variable fail9414a.C.foo.x cannot modify parameter 'x' in contract
fail_compilation/fail9414a.d(82): Error: variable fail9414a.C.foo.__ensure.r cannot modify result 'r' in contract
---
*/
class C
{
int foo(int x)
in
{
int a;
int bar(int y)
in
{
x = 10; // err
y = 10; // err
a = 1; // OK
}
out(s)
{
x = 10; // err
y = 10; // err
s = 10; // err
a = 1; // OK
}
body
{
x = 10; // err
y = 1; // OK
a = 1; // OK
return 2;
}
x = 10; // err
}
out(r)
{
int a;
int baz(int y)
in
{
x = 10; // err
r = 10; // err
y = 10; // err
a = 1; // OK
}
out(s)
{
x = 10; // err
r = 10; // err
y = 10; // err
s = 10; // err
a = 1; // OK
}
body
{
x = 10; // err
r = 10; // err
y = 1; // OK
a = 1; // OK
return 2;
}
x = 10; // err
r = 10; // err
}
body
{
return 1;
}
}
|