mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 23:02:27 +00:00
compiler: allow using OP= with struct fields and slice elements
Do it in a generic way, there is no need in restricting to only variables. Port of #954.
This commit is contained in:
parent
fdb217ec81
commit
1b105a9f1d
3 changed files with 40 additions and 15 deletions
|
@ -33,6 +33,16 @@ var sliceTestCases = []testCase{
|
|||
`,
|
||||
big.NewInt(42),
|
||||
},
|
||||
{
|
||||
"increase slice element with +=",
|
||||
`package foo
|
||||
func Main() int {
|
||||
a := []int{1, 2, 3}
|
||||
a[1] += 40
|
||||
return a[1]
|
||||
}`,
|
||||
big.NewInt(42),
|
||||
},
|
||||
{
|
||||
"complex test",
|
||||
`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue