e7738de6d2
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
32 lines
595 B
Plaintext
32 lines
595 B
Plaintext
const T: usize = 3
|
|
|
|
const N: usize = 3
|
|
|
|
type Holder<U: Type> {
|
|
value: U,
|
|
}
|
|
|
|
type Box<static N: usize> {
|
|
value: i32,
|
|
}
|
|
|
|
fn unwrap<T: Type>(holder: ref<Holder<T>>) -> T {
|
|
return holder.value
|
|
}
|
|
|
|
fn forwardUnwrap<T: Type>(holder: ref<Holder<T>>) -> T {
|
|
return unwrap(holder)
|
|
}
|
|
|
|
fn read<static N: usize>(box: ref<Box<N>>) -> i32 {
|
|
return box.value
|
|
}
|
|
|
|
pub fn main() -> Void {
|
|
let holder: Holder<i32> = Holder { value: 5 }
|
|
let value: i32 = forwardUnwrap(&holder)
|
|
let box: Box<4> = Box { value: 9 }
|
|
let boxed: i32 = read(&box)
|
|
expect (value == 5 && boxed == 9)
|
|
}
|