ethos/tests/array.ethlang
sfja 8b10163805
All checks were successful
Check / Explore-Gitea-Actions (push) Successful in 8s
fix test
2026-03-16 22:33:42 +01:00

31 lines
584 B
Rust

fn main()
{
let array: [int; 3] = [1, 2, 3];
// let a = 4;
// let b = a;
// array[0] = a;
// print_int(array[0]);
// let elem: int = array[0];
// // e xpect: 1
// print_int(elem);
//
// let ptr_to_array: *[int; 3] = &array;
// // e xpect: 2
// print_int(ptr_to_array.*[1]);
// let slice: *[int] = &array[..];
// e xpect: 2
// print_int(slice.*[2]);
// let slice_1: *mut [int] = &mut array[1..3];
// slice_1.*[0] = 4;
// // e xpect: 4
// print_int(array[1]);
}
// vim: syntax=rust commentstring=//\ %s