fix: tuple/import bugs

This commit is contained in:
Shunsuke Shibayama 2023-03-15 12:29:02 +09:00
parent c7b2b8cf55
commit 802eb4fca5
4 changed files with 21 additions and 17 deletions

View file

@ -462,9 +462,9 @@ impl ASTConverter {
Self::param_pattern_to_var(param.pat),
param.t_spec.map(|t| t.t_spec),
));
let method = tmp_expr.clone().attr_expr(
self.convert_ident("__Tuple_getitem__".to_string(), expr.location),
);
let method = tmp_expr
.clone()
.attr_expr(self.convert_ident("__getitem__".to_string(), expr.location));
let args =
Args::new(vec![PosArg::new(Expr::Literal(index))], None, vec![], None);
let tuple_acc = method.call_expr(args);
@ -1391,11 +1391,9 @@ impl ASTConverter {
Self::param_pattern_to_var(param.pat),
param.t_spec.map(|t| t.t_spec),
));
let method =
tmp_expr.clone().attr_expr(self.convert_ident(
"__Tuple_getitem__".to_string(),
stmt.location,
));
let method = tmp_expr.clone().attr_expr(
self.convert_ident("__getitem__".to_string(), stmt.location),
);
let args =
Args::pos_only(vec![PosArg::new(Expr::Literal(index))], None);
let tuple_acc = method.call_expr(args);