1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail10534.d(28): Error: 'a' is not of arithmetic type, it is a int delegate()
5 fail_compilation/fail10534.d(28): Error: 'b' is not of arithmetic type, it is a int delegate()
6 fail_compilation/fail10534.d(29): Error: 'a' is not of arithmetic type, it is a int delegate()
7 fail_compilation/fail10534.d(29): Error: 'b' is not of arithmetic type, it is a int delegate()
8 fail_compilation/fail10534.d(30): Error: 'a' is not of arithmetic type, it is a int delegate()
9 fail_compilation/fail10534.d(30): Error: 'b' is not of arithmetic type, it is a int delegate()
10 fail_compilation/fail10534.d(31): Error: 'a' is not of arithmetic type, it is a int delegate()
11 fail_compilation/fail10534.d(31): Error: 'b' is not of arithmetic type, it is a int delegate()
12 fail_compilation/fail10534.d(36): Error: 'a' is not of arithmetic type, it is a int function()
13 fail_compilation/fail10534.d(36): Error: 'b' is not of arithmetic type, it is a int function()
14 fail_compilation/fail10534.d(37): Error: 'a' is not of arithmetic type, it is a int function()
15 fail_compilation/fail10534.d(37): Error: 'b' is not of arithmetic type, it is a int function()
16 fail_compilation/fail10534.d(38): Error: 'a' is not of arithmetic type, it is a int function()
17 fail_compilation/fail10534.d(38): Error: 'b' is not of arithmetic type, it is a int function()
18 fail_compilation/fail10534.d(39): Error: 'a' is not of arithmetic type, it is a int function()
19 fail_compilation/fail10534.d(39): Error: 'b' is not of arithmetic type, it is a int function()
20 ---
21 */
22 
main()23 void main()
24 {
25     {
26         int delegate() a = ()=>5;
27         int delegate() b = ()=>5;
28         auto c1 = a + b;  // passes (and will crash if c1() called)
29         auto c2 = a - b;  // passes (and will crash if c2() called)
30         auto c3 = a / b;  // a & b not of arithmetic type
31         auto c4 = a * b;  // a & b not of arithmetic type
32     }
33     {
34         int function() a = ()=>5;
35         int function() b = ()=>5;
36         auto c1 = a + b;
37         auto c2 = a - b;
38         auto c3 = a / b;
39         auto c4 = a * b;
40     }
41 }
42