File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
test/SILOptimizer/lifetime_dependence Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -344,7 +344,7 @@ static bool isUnsupportedKeyPathValueType(Type ty) {
344
344
// They would also need a new ABI that's yet to be implemented in order to
345
345
// be properly supported, so let's suppress the descriptor for now if either
346
346
// the container or storage type of the declaration is non-copyable.
347
- if (ty->isNoncopyable ())
347
+ if (ty->isNoncopyable () || !ty-> isEscapable () )
348
348
return true ;
349
349
350
350
return false ;
@@ -356,7 +356,7 @@ bool AbstractStorageDecl::exportsPropertyDescriptor() const {
356
356
357
357
if (!isStatic ()) {
358
358
if (auto contextTy = getDeclContext ()->getDeclaredTypeInContext ()) {
359
- if (contextTy->isNoncopyable ()) {
359
+ if (contextTy->isNoncopyable () || !contextTy-> isEscapable () ) {
360
360
return false ;
361
361
}
362
362
}
Original file line number Diff line number Diff line change @@ -29,16 +29,8 @@ public struct NEImmortal: ~Escapable {
29
29
30
30
class C { }
31
31
32
- // Test diagnostics on keypath getter.
33
- //
34
- // rdar://150073405 ([SILGen] support synthesized _modify on top of borrowed getters with library evolution)
35
- //
36
- // This produces the error:
37
- // <unknown>:0: error: unexpected error produced: lifetime-dependent value returned by generated thunk
38
- // '$s4test17ImplicitAccessorsV10neComputedAA10NEImmortalVvpACTK'
39
- //
40
- // Since this error has no source file, we can't verify the diagnostic!
41
- /*
32
+ // Test that we don't implicitly try to create a keypath getter, since
33
+ // ~Escapable types are not yet supported by keypaths.
42
34
public struct ImplicitAccessors {
43
35
let c : C
44
36
@@ -50,7 +42,6 @@ public struct ImplicitAccessors {
50
42
}
51
43
}
52
44
}
53
- */
54
45
55
46
public struct NoncopyableImplicitAccessors : ~ Copyable & ~ Escapable {
56
47
public var ne: NE
You can’t perform that action at this time.
0 commit comments