July 07, 2019 [Issue 20033] New: Deprecation not triggered with foreach + alias this | ||||
---|---|---|---|---|
| ||||
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: nobody@puremagic.com Reporter: pro.mathias.lang@gmail.com ``` 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. -- |
Copyright © 1999-2021 by the D Language Foundation