File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -6195,7 +6195,12 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
6195
6195
if (Options.PrintExplicitAny )
6196
6196
Printer << " any " ;
6197
6197
6198
- visit (T->getConstraintType ());
6198
+ // FIXME: The desugared type is used here only to support
6199
+ // existential types with protocol typealiases in Swift
6200
+ // interfaces. Verifying that the underlying type of a
6201
+ // protocol typealias is a constriant type is fundamentally
6202
+ // circular, so the desugared type should be written in source.
6203
+ visit (T->getConstraintType ()->getDesugaredType ());
6199
6204
}
6200
6205
6201
6206
void visitLValueType (LValueType *T) {
Original file line number Diff line number Diff line change @@ -38,3 +38,11 @@ public struct S {
38
38
// CHECK: public var q: any main.Q
39
39
public var q : any Q
40
40
}
41
+
42
+
43
+ public protocol ProtocolTypealias {
44
+ typealias A = P
45
+ }
46
+
47
+ // CHECK: public func dependentExistential<T>(value: (T) -> any main.P) where T : main.ProtocolTypealias
48
+ public func dependentExistential< T: ProtocolTypealias > ( value: ( T ) -> T . A ) { }
You can’t perform that action at this time.
0 commit comments