Invalid consumption error
Open
- Dominant language
- Swift
- Stars
- 1.6k
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Description
```
/// A boxed value.
type Indirect {
/// A pointer to the wrapped element.
private let wrapped: PointerToMutable
/// Creates an instance wrapping `value`.
public init(_ value: sink T) {
&self.wrapped = .allocate(count: 1)
&self.wrapped.unsafe_initialize_pointee(fun (_ p: set T) -> Void {
&p = value // <- complains here; but that should be fine.
})
}
// public fun deinit() sink {
// &wrapped.unsafe_pointee().deinit()
// }
// public fun copy() -> Self {
// .new(wrapped.unsafe[].copy())
// }
}
```
Contributor guide
Assessment
This issue has not been assessed yet.