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> {
62116211 if (Options.PrintExplicitAny )
62126212 Printer << " any " ;
62136213
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 ());
62156220 }
62166221
62176222 void visitLValueType (LValueType *T) {
Original file line number Diff line number Diff line change @@ -38,3 +38,11 @@ public struct S {
3838 // CHECK: public var q: any main.Q
3939 public var q : any Q
4040}
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