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 @@ -6211,7 +6211,12 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
6211
6211
if (Options.PrintExplicitAny )
6212
6212
Printer << " any " ;
6213
6213
6214
- visit (T->getConstraintType ());
6214
+ // FIXME: The desugared type is used here only to support
6215
+ // existential types with protocol typealiases in Swift
6216
+ // interfaces. Verifying that the underlying type of a
6217
+ // protocol typealias is a constriant type is fundamentally
6218
+ // circular, so the desugared type should be written in source.
6219
+ visit (T->getConstraintType ()->getDesugaredType ());
6215
6220
}
6216
6221
6217
6222
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