File tree Expand file tree Collapse file tree 3 files changed +31
-16
lines changed
Incremental/Verifier/single-file-private Expand file tree Collapse file tree 3 files changed +31
-16
lines changed Original file line number Diff line number Diff line change @@ -1035,6 +1035,9 @@ static Optional<ActorIsolation> getIsolationFromWitnessedRequirements(
1035
1035
if (!idc)
1036
1036
return None;
1037
1037
1038
+ if (dc->getSelfProtocolDecl ())
1039
+ return None;
1040
+
1038
1041
// Walk through each of the conformances in this context, collecting any
1039
1042
// requirements that have actor isolation.
1040
1043
auto conformances = evaluateOrDefault (
@@ -1167,6 +1170,12 @@ ActorIsolation ActorIsolationRequest::evaluate(
1167
1170
}
1168
1171
}
1169
1172
1173
+ // If this is an accessor, use the actor isolation of its storage
1174
+ // declaration.
1175
+ if (auto accessor = dyn_cast<AccessorDecl>(value)) {
1176
+ return getActorIsolation (accessor->getStorage ());
1177
+ }
1178
+
1170
1179
// If the declaration witnesses a protocol requirement that is isolated,
1171
1180
// use that.
1172
1181
if (auto witnessedIsolation = getIsolationFromWitnessedRequirements (value)) {
@@ -1194,14 +1203,6 @@ ActorIsolation ActorIsolationRequest::evaluate(
1194
1203
}
1195
1204
}
1196
1205
1197
- // If this is an accessor, use the actor isolation of its storage
1198
- // declaration.
1199
- if (auto accessor = dyn_cast<AccessorDecl>(value)) {
1200
- auto storageIsolation = getActorIsolation (accessor->getStorage ());
1201
- if (!storageIsolation.isUnspecified ())
1202
- return inferredIsolation (storageIsolation);
1203
- }
1204
-
1205
1206
// If the declaration is in an extension that has one of the isolation
1206
1207
// attributes, use that.
1207
1208
if (auto ext = dyn_cast<ExtensionDecl>(value->getDeclContext ())) {
Original file line number Diff line number Diff line change @@ -72,3 +72,17 @@ func lookupOnAnyObject(object: AnyObject) { // expected-provides {{lookupOnAnyOb
72
72
// expected-member {{Swift.CVarArg.someMethod}}
73
73
// expected-member {{Swift.CustomStringConvertible.someMethod}}
74
74
// expected-member {{Swift.CustomDebugStringConvertible.someMethod}}
75
+ // expected-member {{Swift.Equatable.someMember}}
76
+ // expected-member{{Swift.CustomDebugStringConvertible.init}}
77
+ // expected-member{{Swift.CVarArg.someMember}}
78
+ // expected-member{{Foundation._KeyValueCodingAndObservingPublishing.someMember}}
79
+ // expected-member{{Swift.Equatable.init}}
80
+ // expected-member{{Swift.Hashable.init}}
81
+ // expected-member{{Swift.CVarArg.init}}
82
+ // expected-member{{Foundation._KeyValueCodingAndObserving.someMember}}
83
+ // expected-member{{Foundation._KeyValueCodingAndObservingPublishing.init}}
84
+ // expected-member{{Swift.CustomDebugStringConvertible.someMember}}
85
+ // expected-member{{Swift.CustomStringConvertible.someMember}}
86
+ // expected-member{{Swift.CustomStringConvertible.init}}
87
+ // expected-member{{Swift.Hashable.someMember}}
88
+ // expected-member{{Foundation._KeyValueCodingAndObserving.init}}
Original file line number Diff line number Diff line change 4
4
// RUN: not %target-swift-frontend -typecheck -debug-cycles %s -build-request-dependency-graph -output-request-graphviz %t.dot -stats-output-dir %t/stats-dir 2> %t.cycles
5
5
// RUN: %FileCheck -check-prefix CHECK-DOT %s < %t.dot
6
6
7
- class Left // expected-error {{'Left' inherits from itself}} expected-note {{through reference here}}
7
+ class Left // expected-error {{'Left' inherits from itself}} expected-note 2 {{through reference here}}
8
8
: Right . Hand { // expected-note {{through reference here}}
9
- class Hand { }
9
+ class Hand { } // expected-note {{through reference here}}
10
10
}
11
11
12
- class Right // expected-note {{through reference here}} expected-note{{class 'Right' declared here}}
12
+ class Right // expected-note 2 {{through reference here}} expected-note{{class 'Right' declared here}}
13
13
: Left . Hand { // expected-note {{through reference here}}
14
- class Hand { }
14
+ class Hand { } // expected-error {{circular reference}}
15
15
}
16
16
17
17
class C : B { } // expected-error{{'C' inherits from itself}}
@@ -30,15 +30,15 @@ class Outer {
30
30
class Inner : Outer { }
31
31
}
32
32
33
- class Outer2 // expected-error {{'Outer2' inherits from itself}} expected-note {{through reference here}}
33
+ class Outer2 // expected-error {{'Outer2' inherits from itself}} expected-note 2 {{through reference here}}
34
34
: Outer2 . Inner { // expected-note {{through reference here}}
35
35
36
- class Inner { }
36
+ class Inner { } // expected-error{{circular reference}}
37
37
}
38
38
39
- class Outer3 // expected-error {{'Outer3' inherits from itself}} expected-note {{through reference here}}
39
+ class Outer3 // expected-error {{'Outer3' inherits from itself}} expected-note 2 {{through reference here}}
40
40
: Outer3 . Inner < Int > { // expected-note {{through reference here}}
41
- class Inner < T> { }
41
+ class Inner < T> { } // expected-error{{circular reference}}
42
42
}
43
43
44
44
// CHECK-DOT: digraph Dependencies
You can’t perform that action at this time.
0 commit comments