Fixes Issue 9312 - With diagnostic is wrong.
Merge pull request #1479 from AndrejMitrovic/Fix9312

Issue 9312 - With statement diagnostic is wrong