4 fail_compilation/testOpApply.d(27): Error: `testOpApply.SameAttr.opApply` called with argument types `(int delegate(int i) pure nothrow @nogc @safe)` matches both:
5 fail_compilation/testOpApply.d(13): `testOpApply.SameAttr.opApply(int delegate(int) @system dg)`
7 fail_compilation/testOpApply.d(18): `testOpApply.SameAttr.opApply(int delegate(int) @system dg)`
13 int opApply(int delegate(int) @system dg
) @system
18 int opApply(int delegate(int) @system dg
) @safe
24 void testSameAttr() @safe
27 foreach (int i
; sa
) {}
33 fail_compilation/testOpApply.d(104): Error: `testOpApply.SameAttr.opApply` called with argument types `(int delegate(int i) pure nothrow @nogc @system)` matches both:
34 fail_compilation/testOpApply.d(13): `testOpApply.SameAttr.opApply(int delegate(int) @system dg)`
36 fail_compilation/testOpApply.d(18): `testOpApply.SameAttr.opApply(int delegate(int) @system dg)`
41 void testSameAttr() @system
44 foreach (int i
; sa
) {}
50 fail_compilation/testOpApply.d(217): Error: `sa.opApply` matches more than one declaration:
51 fail_compilation/testOpApply.d(203): `int(int delegate(int) dg)`
53 fail_compilation/testOpApply.d(208): `int(int delegate(string) dg)`
54 fail_compilation/testOpApply.d(217): Error: cannot uniquely infer `foreach` argument types
61 int opApply(int delegate(int) dg
)
66 int opApply(int delegate(string
) dg
)
72 void testDifferentTypes()
81 fail_compilation/testOpApply.d(317): Error: `sa.opApply` matches more than one declaration:
82 fail_compilation/testOpApply.d(303): `int(int delegate(int) dg)`
84 fail_compilation/testOpApply.d(308): `int(int delegate(long) dg)`
85 fail_compilation/testOpApply.d(317): Error: cannot uniquely infer `foreach` argument types
92 int opApply(int delegate(int) dg
)
97 int opApply(int delegate(long) dg
)
103 void testCovariantTypes()
110 See https://issues.dlang.org/show_bug.cgi?id=21683
114 fail_compilation/testOpApply.d(420): Error: `sa.opApply` matches more than one declaration:
115 fail_compilation/testOpApply.d(404): `int(int delegate(int) dg)`
117 fail_compilation/testOpApply.d(410): `int(int delegate(ref int) dg)`
118 fail_compilation/testOpApply.d(420): Error: cannot uniquely infer `foreach` argument types
123 struct DifferentQualifiers
126 int opApply(int delegate(int) dg
)
132 int opApply(int delegate(ref int) dg
)
139 void testDifferentQualifiers()
141 DifferentQualifiers sa
;
148 fail_compilation/testOpApply.d(504): Error: `sa.opApply` matches more than one declaration:
149 fail_compilation/testOpApply.d(404): `int(int delegate(int) dg)`
151 fail_compilation/testOpApply.d(410): `int(int delegate(ref int) dg)`
152 fail_compilation/testOpApply.d(504): Error: cannot uniquely infer `foreach` argument types
157 void testDifferentQualifiersRef()
159 DifferentQualifiers sa
;
160 foreach (ref i
; sa
) {}