Because the App Store enforces uniqueness, I'm saying it's not intutive that we'd have to take another measure on top of that to make an attempt at uniqing. Did Apple just think it would be faster to come up with identifiers if they made this recommendation? It just looks like noise to me.
Post
Replies
Boosts
Views
Activity
I've seen this several times in the past year, including the past three days. Please stop doing this!
You are conflating the ideas of instances and metatypes. Is that sentence enough for you to solve the problem or do you need to know where to find links with relevant information?
I think this is best illustrated with a capture list. You can capture the object, but it's not the default behavior.
final class Object {
var closure: () -> Object? = { nil }
}
@Test func test() {
do {
var object: Optional = Object()
object!.closure = { object }
weak var weakObject = object
object = nil
#expect(weakObject == nil)
}
do {
var object: Optional = Object()
object!.closure = { [object] in object }
weak var weakObject = object
object = nil
#expect(weakObject != nil)
}
}