fix: make::expr_method_call() -> MethodCallExpr

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
This commit is contained in:
Prajwal S N 2025-04-11 02:49:34 +05:30
parent 728d72fbe1
commit ab620e367d
No known key found for this signature in database
GPG key ID: 60701A603988FAC2
7 changed files with 27 additions and 27 deletions

View file

@ -640,7 +640,7 @@ pub fn expr_method_call(
receiver: ast::Expr,
method: ast::NameRef,
arg_list: ast::ArgList,
) -> ast::Expr {
) -> ast::MethodCallExpr {
expr_from_text(&format!("{receiver}.{method}{arg_list}"))
}
pub fn expr_macro_call(f: ast::Expr, arg_list: ast::ArgList) -> ast::Expr {

View file

@ -423,13 +423,8 @@ impl SyntaxFactory {
method: ast::NameRef,
arg_list: ast::ArgList,
) -> ast::MethodCallExpr {
// FIXME: `make::expr_method_call` should return a `MethodCallExpr`, not just an `Expr`
let ast::Expr::MethodCallExpr(ast) =
make::expr_method_call(receiver.clone(), method.clone(), arg_list.clone())
.clone_for_update()
else {
unreachable!()
};
let ast = make::expr_method_call(receiver.clone(), method.clone(), arg_list.clone())
.clone_for_update();
if let Some(mut mapping) = self.mappings() {
let mut builder = SyntaxMappingBuilder::new(ast.syntax().clone());