fix <rdar://problem/20894455> "variable was never mutated" diagnostic does not take #if into account

Swift SVN r28633
This commit is contained in:
Chris Lattner
2015-05-15 18:30:32 +00:00
parent 19017a287f
commit 9bbce68ec8
3 changed files with 48 additions and 0 deletions

View File

@@ -146,4 +146,13 @@ func testForceValueExpr() {
a!.g()
}
// <rdar://problem/20894455> "variable was never mutated" diagnostic does not take #if into account
func testBuildConfigs() {
let abc = 42 // no warning.
var mut = 18 // no warning.
#if false
mut = abc // These uses prevent abc/mut from being unused/unmutated.
#endif
}