mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00

* Make `foreach_reverse` with a delegate an error
Deprecation goes back to at least 2016:
68fb91a130 (diff-13f50d9dea67df89a0535d6b8957f3145d49f71f6b72fdd3913f329a265e1423R1155)
17 lines
240 B
D
17 lines
240 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/deprecate1553.d(16): Error: cannot use `foreach_reverse` with a delegate
|
|
---
|
|
*/
|
|
|
|
struct S
|
|
{
|
|
int dg(int delegate(ref int a)) { return 0; }
|
|
}
|
|
|
|
void main()
|
|
{
|
|
S s;
|
|
foreach_reverse(a; &s.dg) {}
|
|
}
|