From 09f178481077062814f100c2c6ac1d9b5d3b6c64 Mon Sep 17 00:00:00 2001 From: sofia Date: Sun, 27 Jul 2025 02:56:47 +0300 Subject: [PATCH] Update AssociatedFunctionBlock parsing --- reid/src/ast/parse.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reid/src/ast/parse.rs b/reid/src/ast/parse.rs index b96c44c..fb601d5 100644 --- a/reid/src/ast/parse.rs +++ b/reid/src/ast/parse.rs @@ -982,7 +982,13 @@ impl Parse for AssociatedFunctionBlock { stream.expect(Token::BraceOpen)?; let mut functions = Vec::new(); while let Some(Token::FnKeyword) = stream.peek() { - functions.push(stream.parse()?); + let mut fun: FunctionDefinition = stream.parse()?; + fun.0.self_kind = match fun.0.self_kind { + SelfKind::Borrow(_) => SelfKind::Borrow(ty.0.clone()), + SelfKind::MutBorrow(_) => SelfKind::MutBorrow(ty.0.clone()), + SelfKind::None => SelfKind::None, + }; + functions.push(fun); } stream.expect(Token::BraceClose)?;