D-Programming-Language/dmd — pull request #3567 by lionello (2014-05-21 18:21:18+00:00)
Title: Issue 9570 - Wrong foreach index implicit conversion error

Initial attempt to fix bug 9570.

Added a IntRange* to VarDeclaration which tracks the range for variables for which the range is known, in this case foreach over range, array and sarray. This range will only be used when the iterator is declared const or immutable.

Added a simple test case, based on bug report. This PR is also needed to fix bug 259 (prevent false positives.)