reid-llvm/examples/associated_functions_shorthand.reid
2025-08-03 20:24:34 +03:00

30 lines
373 B
Plaintext

import std::print;
import std::from_str;
import std::String;
struct Otus {
field: u32,
}
impl Otus {
fn test(&self) -> u32 {
*self.field
}
}
impl i32 {
fn test(self) -> u32 {
43
}
}
fn main() -> u32 {
let otus = Otus { field: 17 };
print(from_str("otus: ") + otus.test() as u64);
otus.field;
return otus.test();
}