You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Exclusivity] Treat warning violations with reabstraction thunks as errors
In Swift 4.1 we fixed a false negative and started looking through
reabstraction thunks to statically find exclusivity violations. To lessen
source impact, we treated these violations as warnings. This commit upgrades
those warnings to errors.
rdar://problem/34669400
// expected-error@+2{{overlapping accesses to 'x', but modification requires exclusive access; consider copying to a local variable}}
201
+
// expected-note@+1{{conflicting access is here}}
202
+
takesInoutAndNoEscapeClosure(&x,{ _ = x })
203
+
}
204
+
205
+
func inoutWriteWriteInout(x:inoutInt){
206
+
// expected-error@+2{{overlapping accesses to 'x', but modification requires exclusive access; consider copying to a local variable}}
207
+
// expected-note@+1{{conflicting access is here}}
208
+
takesInoutAndNoEscapeClosure(&x,{ x =42})
209
+
}
210
+
199
211
func callsTakesInoutAndNoEscapeClosureWithRead(){
200
212
varlocal=5
201
213
takesInoutAndNoEscapeClosure(&local){ // expected-error {{overlapping accesses to 'local', but modification requires exclusive access; consider copying to a local variable}}
0 commit comments