fix issue 9768 - No line number for wrong foreach type
Merge pull request #1974 from hpohl/9768

9768 - No line number for wrong foreach type