https://issues.dlang.org/show_bug.cgi?id=20033
Issue ID: 20033
Summary: Deprecation not triggered with foreach + alias this
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
```
struct Test {
import std.typecons : Tuple;
alias KVT = Tuple!(string, "key", string, "value");
struct Range {
bool empty () { return false; }
KVT front() { return KVT.init; }
void popFront() {}
}
auto byKeyValue () { return Range.init; }
deprecated("This was a bad idea")
alias byKeyValue this;
}
void main ()
{
foreach (k, v; Test.init)
{
}
}
```
I expect `dmd -de test.d` to error out, but no message is triggered.
--