ASTDemangler: Add support for constrained existential compositions

This commit is contained in:
Slava Pestov
2025-05-22 18:10:33 -04:00
parent ca0e984c94
commit 4338a55154
2 changed files with 99 additions and 40 deletions

View File

@@ -0,0 +1,36 @@
// RUN: %target-swift-frontend -emit-ir %s -g -target %target-swift-5.9-abi-triple
public protocol P<A, B> {
associatedtype A
associatedtype B
}
public protocol Q<C> {
associatedtype C
}
public protocol R {}
public class C<T: Equatable> {}
public func foo(_ a: any P<Int, Float> & R) {}
public func foo(_ a: any P<Int, Float> & Q<String>) {}
public func foo(_ a: any P<Int, Float> & Q<String> & R) {}
public func foo(_ a: any P<Int, Float> & Q<String> & R & C<Bool>) {}
public func foo(_ a: any P<Int, Float> & Q<String> & R & AnyObject) {}
public func foo(_ a: any (P<Int, Float> & R).Type) {}
public func foo(_ a: any (P<Int, Float> & Q<String>).Type) {}
public func foo(_ a: any (P<Int, Float> & Q<String> & R).Type) {}
public func foo(_ a: any (P<Int, Float> & Q<String> & R & C<Bool>).Type) {}
public func foo(_ a: any (P<Int, Float> & Q<String> & R & AnyObject).Type) {}
public func foo(_ a: (any P<Int, Float> & R).Type) {}
public func foo(_ a: (any P<Int, Float> & Q<String>).Type) {}
public func foo(_ a: (any P<Int, Float> & Q<String> & R).Type) {}
public func foo(_ a: (any P<Int, Float> & Q<String> & R & C<Bool>).Type) {}
public func foo(_ a: (any P<Int, Float> & Q<String> & R & AnyObject).Type) {}
public struct Foo<each T, U> {
public var a1: (repeat any P<each T, U> & R)
}