Skip to content

Commit

Permalink
[Feature] [Compiler-V2] += and the like (#14583)
Browse files Browse the repository at this point in the history
* impl += for *(lhs()) += rhs()

* impl += for other cases

* refactor

* format

* refactor

* optimize

* add tests

* update tests

* rename tmp

* add tests

* add todo

* change loc

* remove unused var

* update test

* gate feature

* update tests

* add transactional tests

* format

* add tests

* add tests

* move the transformation to expansion phase

* refactor

* support more ops

* format

* add test

* update tests

* remove test dir

* rename testdir

* update tests

* add tests

* remove commented function

* remove comments

* update tests

* update tests

* update tests

* typo

* refactor

* add tests

* bug fix: eval order of op =

* bug fix cont: eval order op =

* comment

* refactor

* update tests

* update test

* update tests

* update tests

* remove comment

* update comments

* comment

* comment

* refactor

* refactor

* refactor

* comment

* refactor

* add tests

* add tests

---------

Co-authored-by: Zekun Wang <[email protected]>
  • Loading branch information
fEst1ck and Zekun Wang authored Oct 3, 2024
1 parent 1c97501 commit 9271edf
Show file tree
Hide file tree
Showing 40 changed files with 3,380 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

Diagnostics:
error: cannot mutably borrow from an immutable ref
┌─ tests/op-equal/error_not_shown.move:9:17
9 │ let p = &mut self.0;
│ ^^^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module 0x42::test {
struct Coin(u256) has drop;

fun inc_old(x: &u256) {
*x = *x + 1;
}

fun coin_inc_new_1(self: &Coin) {
let p = &mut self.0;
*p += 1;
}
}
Loading

0 comments on commit 9271edf

Please sign in to comment.