forked from cosmonaut/wraith-lang
32 lines
507 B
OpenEdge ABL
32 lines
507 B
OpenEdge ABL
struct Foo {
|
|
static Func2<U>(u: U) : U {
|
|
return u;
|
|
}
|
|
|
|
static Func<T>(t: T): T {
|
|
foo: T = t;
|
|
return Foo.Func2(foo);
|
|
}
|
|
}
|
|
|
|
struct MemoryBlock<T>
|
|
{
|
|
start: MemoryAddress;
|
|
capacity: uint;
|
|
|
|
AddressOf(count: uint): MemoryAddress
|
|
{
|
|
return start + (count * @sizeof<T>());
|
|
}
|
|
}
|
|
|
|
struct Program {
|
|
static Main(): int {
|
|
x: int = 4;
|
|
y: int = Foo.Func(x);
|
|
addr: MemoryAddress = @malloc(y);
|
|
@free(addr);
|
|
return x;
|
|
}
|
|
}
|