File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
test/AssociatedTypeInference Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -4683,7 +4683,10 @@ void ConformanceChecker::resolveSingleWitness(ValueDecl *requirement) {
4683
4683
ReferencedAssociatedTypesRequest{requirement},
4684
4684
TinyPtrVector<AssociatedTypeDecl *>());
4685
4685
for (auto assocType : referenced) {
4686
- if (Conformance->getTypeWitness (assocType)->hasError ()) {
4686
+ auto typeWitness = Conformance->getTypeWitness (assocType);
4687
+ if (!typeWitness)
4688
+ return ;
4689
+ if (typeWitness->hasError ()) {
4687
4690
Conformance->setInvalid ();
4688
4691
return ;
4689
4692
}
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -emit-ir %s
2
+
3
+ // https://github.com/swiftlang/swift/issues/75371
4
+
5
+ public protocol MyProtocol {
6
+ associatedtype Value = Self
7
+
8
+ static var originalValue : Value { get }
9
+ static var copyValue : Value { get }
10
+ }
11
+
12
+ public struct MyStruct : MyProtocol { }
13
+
14
+ extension MyStruct {
15
+ public static let originalValue = Self ( )
16
+ public static let copyValue = originalValue
17
+ }
18
+
You can’t perform that action at this time.
0 commit comments