e0/examples/struct.e0

17 lines
192 B
Text
Raw Permalink Normal View History

2022-06-17 14:50:06 +00:00
type IntPair = struct {
fst: int,
snd: int,
}
fn getX() -> IntPair {
return new IntPair {
2022-06-17 14:50:06 +00:00
fst: 4,
snd: 6,
};
}
2022-06-17 14:50:06 +00:00
fn main() -> int {
let x = getX();
2022-06-17 14:50:06 +00:00
return x.fst + x.snd;
}