Skip to content

Commit e56797c

Browse files
authored
Merge pull request swiftlang#35316 from atrick/fix-weakmirrorlifetime
Add a _fixLifetime call to stdlib/WeakMirror.swift test.
2 parents 28bf85f + 2c92663 commit e56797c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/stdlib/WeakMirror.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ mirrors.test("class/NativeSwiftClassHasNativeWeakReferenceNoLeak") {
113113
let mirror = Mirror(reflecting: parent)
114114
let children = Array(mirror.children)
115115
let extractedChild = children[0].1 as! NativeSwiftClass
116+
// If child is destroyed, the above cast will fail.
117+
_fixLifetime(child)
116118
expectNotNil(extractedChild)
117119
expectNotNil(verifier)
118120
}

0 commit comments

Comments
 (0)