We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
impl
Currently, Mun only allows functions to be defined independent from a struct. We want to be able to associate functions with a struct type, as such:
pub struct Foo { x: f32, y: f32 } impl Foo { pub fn new(x: f32, y: f32) -> Self { Self { x, y } } pub fn set_x(&mut self, x: f32) { self.x = x; } }
The above syntax is hypothetical. An important question to consider is whether we need to have a special case for struct(gc) vs struct(value).
struct(gc)
struct(value)
Similar to Rust, impl blocks for member functions can be spread across multiple source files.
Definition of Done
self
The text was updated successfully, but these errors were encountered:
baszalmstra
Wodann
No branches or pull requests
Currently, Mun only allows functions to be defined independent from a struct. We want to be able to associate functions with a struct type, as such:
The above syntax is hypothetical. An important question to consider is whether we need to have a special case for
struct(gc)
vsstruct(value)
.Similar to Rust,
impl
blocks for member functions can be spread across multiple source files.Definition of Done
impl
blocks feat: parsing & hir of impl blocks #551self
in function signatures feat: infer self & Self HIR types #564The text was updated successfully, but these errors were encountered: