File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -2427,8 +2427,9 @@ ConstraintSystem::getTypeOfMemberReference(
2427
2427
2428
2428
// Adjust the opened type for concurrency.
2429
2429
Type origOpenedType = openedType;
2430
- if ((isa<AbstractFunctionDecl>(value) || isa<EnumElementDecl>(value)) &&
2431
- !isRequirementOrWitness (locator)) {
2430
+ if (isRequirementOrWitness (locator)) {
2431
+ // Don't adjust when doing witness matching, because that can cause cycles.
2432
+ } else if (isa<AbstractFunctionDecl>(value) || isa<EnumElementDecl>(value)) {
2432
2433
unsigned numApplies = getNumApplications (
2433
2434
value, hasAppliedSelf, functionRefKind);
2434
2435
openedType = adjustFunctionTypeForConcurrency (
Original file line number Diff line number Diff line change @@ -10,3 +10,20 @@ public struct S : P {
10
10
public func g( _: Int ) { }
11
11
public func f( _: T ) { }
12
12
}
13
+
14
+ // https://github.com/apple/swift/issues/61602
15
+ @available ( SwiftStdlib 5 . 1 , * )
16
+ @MainActor protocol ProtocolWithAssociatedTypes {
17
+ associatedtype ID : Hashable
18
+ associatedtype Value
19
+
20
+ subscript( _ id: ID ) -> Value { get set }
21
+ }
22
+
23
+ @available ( SwiftStdlib 5 . 1 , * )
24
+ final class ClassConforming < ID: Hashable , Value> : ProtocolWithAssociatedTypes {
25
+ subscript( id: ID ) -> Value {
26
+ get { fatalError ( ) }
27
+ set { fatalError ( ) }
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments