hylo-lang / hylo-lang/hylo

Invalid consumption error

Open
#1,663 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.