edlang/lib/edlang_driver/tests/programs/struct_impl.ed

22 lines
226 B
Rust
Raw Normal View History

2024-05-07 06:49:40 +00:00
extern fn printf(a: &str);
fn main() -> u32 {
let x: A = A {
a: 2
};
let y: u32 = x.hello(4);
return y;
}
struct A {
a: u32,
}
impl A {
pub fn hello(self: &A, x: u32) -> u32 {
return self.a + x;
}
}