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 {
1460
1460
// /
1461
1461
// / \returns true if we diagnosed the entity, \c false otherwise.
1462
1462
bool diagnoseReferenceToUnsafeGlobal (ValueDecl *value, SourceLoc loc) {
1463
- if (!shouldDiagnoseExistingDataRaces ( getDeclContext ()) )
1463
+ if (!ctx. LangOpts . WarnConcurrency )
1464
1464
return false ;
1465
1465
1466
1466
// 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 {
5
5
get async { 0 }
6
6
}
7
7
8
- var intThrowsProp : Int { // expected-note 2 {{var declared here}}
8
+ var intThrowsProp : Int {
9
9
get throws { 0 }
10
10
}
11
11
12
12
var asyncThrowsProp : Int {
13
- // expected-warning@+1 {{reference to var 'intThrowsProp' is not concurrency-safe because it involves shared mutable state}}
14
13
get async throws { try await intAsyncProp + intThrowsProp }
15
14
}
16
15
17
16
func hello( ) async {
18
- // expected-warning@+1 {{reference to var 'intThrowsProp' is not concurrency-safe because it involves shared mutable state}}
19
17
_ = intThrowsProp // expected-error{{property access can throw, but it is not marked with 'try' and the error is not handled}}
20
18
21
19
_ = intAsyncProp // expected-error{{property access is 'async' but is not marked with 'await'}}
@@ -25,7 +23,7 @@ class C {
25
23
var counter : Int = 0
26
24
}
27
25
28
- var refTypeThrowsProp : C { // expected-note {{var declared here}}
26
+ var refTypeThrowsProp : C {
29
27
get throws { return C ( ) }
30
28
}
31
29
@@ -34,9 +32,8 @@ var refTypeAsyncProp : C {
34
32
}
35
33
36
34
func salam( ) async {
37
- // expected-warning@+1 {{reference to var 'refTypeThrowsProp' is not concurrency-safe because it involves shared mutable state}}
38
35
_ = refTypeThrowsProp // expected-error{{property access can throw, but it is not marked with 'try' and the error is not handled}}
39
36
40
37
41
38
_ = 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