@@ -33,7 +33,14 @@ struct G<T> {
33
33
subscript<U: Hashable>(x: U) -> T { get set }
34
34
}
35
35
36
+ class C1: C { }
37
+ class C2: C1 {
38
+ var reabstracted: () -> ()
39
+ }
40
+
36
41
sil_vtable C {}
42
+ sil_vtable C1 {}
43
+ sil_vtable C2 {}
37
44
38
45
// CHECK: %TSi = type <{ [[WORD:i.*]] }>
39
46
@@ -195,6 +202,10 @@ sil_vtable C {}
195
202
// CHECK-SAME: void (%swift.function*, %T8keypaths1SV*)* @m_get,
196
203
// CHECK-SAME: void (%swift.function*, %T8keypaths1SV*)* @m_set }>
197
204
205
+ // -- %m2: reabstracted
206
+ // Note: the contents here aren't interesting. The test triggered infinite
207
+ // looping in the compiler at one point.
208
+ // CHECK: [[KP_M:@keypath.*]] = private global <{ {{.*}} }> <{
198
209
199
210
// -- %i: Gen<A>.x
200
211
// CHECK: [[KP_I:@keypath.*]] = private global <{ {{.*}} }> <{
@@ -261,6 +272,7 @@ entry:
261
272
%k = keypath $KeyPath<S, Int>, (root $S; gettable_property $Int, id @k_id : $@convention(thin) () -> (), getter @k_get : $@convention(thin) (@in_guaranteed S) -> @out Int)
262
273
%l = keypath $KeyPath<C, Int>, (root $C; settable_property $Int, id #C.w!getter.1, getter @l_get : $@convention(thin) (@in_guaranteed C) -> @out Int, setter @l_set : $@convention(thin) (@in_guaranteed Int, @in_guaranteed C) -> ())
263
274
%m = keypath $KeyPath<S, () -> ()>, (root $S; settable_property $() -> (), id ##S.reabstracted, getter @m_get : $@convention(thin) (@in_guaranteed S) -> @out @callee_guaranteed () -> @out (), setter @m_set : $@convention(thin) (@in_guaranteed @callee_guaranteed () -> @out (), @inout S) -> ())
275
+ %m2 = keypath $KeyPath<C2, () -> ()>, (root $C2; settable_property $() -> (), id ##C2.reabstracted, getter @m2_get : $@convention(thin) (@in_guaranteed C2) -> @out @callee_guaranteed () -> @out (), setter @m2_set : $@convention(thin) (@in_guaranteed @callee_guaranteed () -> @out (), @inout C2) -> ())
264
276
265
277
return undef : $()
266
278
}
@@ -274,6 +286,9 @@ sil @l_set : $@convention(thin) (@in_guaranteed Int, @in_guaranteed C) -> ()
274
286
sil @m_get : $@convention(thin) (@in_guaranteed S) -> @out @callee_guaranteed () -> @out ()
275
287
sil @m_set : $@convention(thin) (@in_guaranteed @callee_guaranteed () -> @out (), @inout S) -> ()
276
288
289
+ sil @m2_get : $@convention(thin) (@in_guaranteed C2) -> @out @callee_guaranteed () -> @out ()
290
+ sil @m2_set : $@convention(thin) (@in_guaranteed @callee_guaranteed () -> @out (), @inout C2) -> ()
291
+
277
292
struct Gen<T, U> {
278
293
var x: T
279
294
var y: U
0 commit comments