Apply same self-thing to all dot-syntaxes, actually

This commit is contained in:
Sofia 2025-07-28 01:10:27 +03:00
parent 4844cebd56
commit 2a6aceb052

View File

@ -609,18 +609,18 @@ impl Expression {
Void,
first_param.1,
)
.unroll_borrows()
.resolve_ref(type_refs.types);
let backing_var = first_param.backing_var().expect("todo").1.clone();
*first_param = if backing_var == "self" {
let ExprKind::Borrow(val, _) = &first_param.0 else {
panic!()
};
*val.clone()
} else {
first_param.clone()
};
if let TypeKind::Borrow(inner, _) = type_kind {
if let TypeKind::Borrow(..) = *inner.clone() {
*type_kind = type_kind.unroll_borrows();
let ExprKind::Borrow(val, _) = &first_param.0 else {
panic!()
};
*first_param = *val.clone();
}
}
if let Some((mutable, _)) = type_refs.find_var(&backing_var) {
if !mutable {