struct Foo { static Func2(u: U) : U { return u; } static Func(t: T): T { foo: T = t; return Foo.Func2(foo); } } struct MemoryBlock { start: MemoryAddress; capacity: uint; static Init(capacity: uint): MemoryBlock { return MemoryBlock { capacity: capacity, start: @malloc(capacity * @sizeof()) }; } AddressOf(index: uint): MemoryAddress { return start + (index * @sizeof()); } Get(index: uint): T { return @dereference(AddressOf(index)); } Set(index: uint, value: T): void { @memcpy(AddressOf(index), @addr(value), @sizeof()); } Free(): void { @free(start); } } struct Array { memoryBlock: MemoryBlock; static Init(capacity: uint): Array { return Array { memoryBlock: MemoryBlock.Init(capacity) }; } Get(index: uint): T { return memoryBlock.Get(index); } Set(index: uint, value: T): void { memoryBlock.Set(index, value); } } struct Program { static Main(): int { array: Array = Array.Init(4); x: int = 4; y: int = Foo.Func(x); array.Set(0, 2); array.Set(1, 0); array.Set(2, 5); array.Set(3, 9); Console.PrintLine("%i", array.Get(0)); Console.PrintLine("%i", array.Get(3)); return 0; } }