COW-hazards between SE-0380 (Lexical Lifetimes) and SE-0429 (Partial Consumption)
Swift Forums
COW-hazards between SE-0380 (Lexical Lifetimes) and SE-0429 (Partial Consumption)
this is a pattern i get burned by when having LLMs write Swift code: here, S is a noncopyable struct, with a noncopyable field T and a copyable field U. but U is only copyable because it needs to support protocol conformances (like Sequence). neither field should ever actually be copied - if they do, that’s a very bad day for this barbie. struct S: ~Copyable { struct T: ~Copyable { var x: [Int] } struct U { var y: [Int] } let t: T let u: U } if you, or...
0 comments
No comments yet.