Updated codegen for class decl

This commit is contained in:
2026-06-25 19:47:07 +02:00
parent 243b4ba5d0
commit 2549535e4b
4 changed files with 35 additions and 37 deletions
-15
View File
@@ -126,18 +126,3 @@ pub struct FieldDeclStmt {
pub decl: FieldDecl,
pub init: Option<Expression>,
}
impl FunctionDecl {
pub fn is_using_self(&self) -> bool {
match self.params.0.get(0) {
Some(VarDecl { name, .. }) => {
if let Pattern::Path(_, v) = name {
v.0.len() == 1 && v.0[0].0 == "self"
} else {
false
}
}
_ => false,
}
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ pub fn find_function_call<'a>(
) -> Option<&'a Spanned<FunctionDecl>> {
items.iter().find_map(|v| {
if let ClassItem::Method(m) = v {
if m.item.is_using_self() && &m.item.name == name {
if m.item.self_param.is_some() && &m.item.name == name {
Some(m)
} else {
None