File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
test/decl/protocol/existential_member_access Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change 55/// var types = SwiftTypePair(typeOf: expr, type2: SwiftType<Int>.self)
66/// types.assertTypesAreEqual()
77/// ```
8- struct SwiftType < T> { }
8+ struct SwiftType < T> {
9+ init ( _: T ) { }
10+ }
911struct SwiftTypePair < T1, T2> {
1012 init ( typeOf: T1 , type2: SwiftType < T2 > . Type ) { }
1113
@@ -166,3 +168,28 @@ do {
166168 let exist : any CompositionBrokenClassConformance_b & BadConformanceClass
167169 exist. method ( false ) // expected-error {{type of expression is ambiguous without a type annotation}}
168170}
171+
172+ // https://github.com/swiftlang/swift/issues/65533
173+ do {
174+ protocol P< A> {
175+ associatedtype A
176+
177+ func item( ) -> A
178+ }
179+
180+ class Class { }
181+
182+ func test< GP, ClassGP: Class > (
183+ existGP: any P < GP > ,
184+ existClassGP: any P < ClassGP >
185+ ) {
186+ do {
187+ let result = SwiftType ( existGP. item ( ) )
188+ let _: SwiftType < GP > = result
189+ }
190+ do {
191+ let result = SwiftType ( existClassGP. item ( ) )
192+ let _: SwiftType < ClassGP > = result
193+ }
194+ }
195+ }
You can’t perform that action at this time.
0 commit comments