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 5
5
/// var types = SwiftTypePair(typeOf: expr, type2: SwiftType<Int>.self)
6
6
/// types.assertTypesAreEqual()
7
7
/// ```
8
- struct SwiftType < T> { }
8
+ struct SwiftType < T> {
9
+ init ( _: T ) { }
10
+ }
9
11
struct SwiftTypePair < T1, T2> {
10
12
init ( typeOf: T1 , type2: SwiftType < T2 > . Type ) { }
11
13
@@ -166,3 +168,28 @@ do {
166
168
let exist : any CompositionBrokenClassConformance_b & BadConformanceClass
167
169
exist. method ( false ) // expected-error {{type of expression is ambiguous without a type annotation}}
168
170
}
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