Fixed vptr condition on static methods

This commit is contained in:
2026-06-12 16:21:46 +02:00
parent 526b479ea4
commit b19b1bb41d
3 changed files with 21 additions and 13 deletions
+15
View File
@@ -125,3 +125,18 @@ 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,
}
}
}