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> {
61956195 if (Options.PrintExplicitAny )
61966196 Printer << " any " ;
61976197
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 ());
61996204 }
62006205
62016206 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