[SR-420] Incorrect Code Coverage for Optional Binding with Else Statement #43037
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
code coverage
Area → source tooling: code coverage
compiler
The Swift compiler in itself
Attachment: Download
Environment
Xcode 7.2 (7C68), Mac OS X 10.11.1 (15B42)
Additional Detail from JIRA
md5: ad23358574c29bc8befa81db8e7bb3e6
Issue Description:
When testing code that involves an optional binding statement and an else statement, the swift compiler (or at least Xcode) reports that a statement, that should not be reachable, is not covered.
Example to reproduce:
When testing the code above by calling it twice, once with a string instance and once with nil, code coverage will indicate that a statement after the else statement is untested (see attached screenshot).
You can find the full example project on GitHub: https://github.com/Ben-G/AppleBugProjects/tree/master/CodeCoverageIssue.
The text was updated successfully, but these errors were encountered: