File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1460,7 +1460,7 @@ namespace {
14601460 // /
14611461 // / \returns true if we diagnosed the entity, \c false otherwise.
14621462 bool diagnoseReferenceToUnsafeGlobal (ValueDecl *value, SourceLoc loc) {
1463- if (!shouldDiagnoseExistingDataRaces ( getDeclContext ()) )
1463+ if (!ctx. LangOpts . WarnConcurrency )
14641464 return false ;
14651465
14661466 // Only diagnose direct references to mutable global state.
Original file line number Diff line number Diff line change @@ -5,17 +5,15 @@ var intAsyncProp : Int {
55 get async { 0 }
66}
77
8- var intThrowsProp : Int { // expected-note 2 {{var declared here}}
8+ var intThrowsProp : Int {
99 get throws { 0 }
1010}
1111
1212var asyncThrowsProp : Int {
13- // expected-warning@+1 {{reference to var 'intThrowsProp' is not concurrency-safe because it involves shared mutable state}}
1413 get async throws { try await intAsyncProp + intThrowsProp }
1514}
1615
1716func hello( ) async {
18- // expected-warning@+1 {{reference to var 'intThrowsProp' is not concurrency-safe because it involves shared mutable state}}
1917 _ = intThrowsProp // expected-error{{property access can throw, but it is not marked with 'try' and the error is not handled}}
2018
2119 _ = intAsyncProp // expected-error{{property access is 'async' but is not marked with 'await'}}
@@ -25,7 +23,7 @@ class C {
2523 var counter : Int = 0
2624}
2725
28- var refTypeThrowsProp : C { // expected-note {{var declared here}}
26+ var refTypeThrowsProp : C {
2927 get throws { return C ( ) }
3028}
3129
@@ -34,9 +32,8 @@ var refTypeAsyncProp : C {
3432}
3533
3634func salam( ) async {
37- // expected-warning@+1 {{reference to var 'refTypeThrowsProp' is not concurrency-safe because it involves shared mutable state}}
3835 _ = refTypeThrowsProp // expected-error{{property access can throw, but it is not marked with 'try' and the error is not handled}}
3936
4037
4138 _ = refTypeAsyncProp // expected-error {{property access is 'async' but is not marked with 'await'}}
42- }
39+ }
You can’t perform that action at this time.
0 commit comments