Skip to content

Commit

Permalink
fix package test
Browse files Browse the repository at this point in the history
  • Loading branch information
rahxephon89 committed Jul 9, 2024
1 parent ede2a8f commit 16f59a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions third_party/move/move-compiler/src/expansion/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,11 @@ fn call_to_vector_borrow(
let borrow_fun = if mutable { "borrow_mut" } else { "borrow" };
let access = E::ModuleAccess::new(
*loc,
E::ModuleAccess_::ModuleAccess(sp(*loc, ident), Name::new(*loc, Symbol::from(borrow_fun))),
E::ModuleAccess_::ModuleAccess(
sp(*loc, ident),
Name::new(*loc, Symbol::from(borrow_fun)),
None,
),
);
let vector_var = exp_(context, e.clone());
sp(
Expand Down Expand Up @@ -2791,7 +2795,7 @@ fn exp_(context: &mut Context, sp!(loc, pe_): P::Exp) -> E::Exp {
PE::Borrow(mut_, pr) => {
if let PE::Index(ref e, ref i) = pr.value {
// handling `&_[_]` or `&mut _[_]`
if context.env.flags().v2() {
if context.env.flags().compiler_v2() {
if let PE::Name(sp!(_, ref ptn), _) = e.value {
let name = ptn.name();
if is_struct_in_current_module(context, name) {
Expand Down Expand Up @@ -2829,7 +2833,7 @@ fn exp_(context: &mut Context, sp!(loc, pe_): P::Exp) -> E::Exp {
},
PE::Cast(e, ty) => EE::Cast(exp(context, *e), type_(context, ty)),
PE::Index(e, i) => {
if context.env.flags().v2() {
if context.env.flags().compiler_v2() {
// handling `_[_]` or `_[_]` (without `&` or `&mut`)
if let PE::Name(sp!(_, ref ptn), _) = e.value {
let name = ptn.name();
Expand Down
1 change: 1 addition & 0 deletions third_party/move/move-compiler/src/parser/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ impl NameAccessChain_ {
NameAccessChain_::One(x) => x,
NameAccessChain_::Two(_, x) => x,
NameAccessChain_::Three(_, x) => x,
NameAccessChain_::Four(_, x, _) => x,
}
}
}
Expand Down

0 comments on commit 16f59a3

Please sign in to comment.