Skip to content

assignment chain cause compatibility issue #2770

Closed
@HerrCai0907

Description

@HerrCai0907

Bug description

In Typescript, it will print

set 1
set 1

But In Assemblyscript, it will print

set 1
get
set 123

Which will cause compatibility issue when port code.

class X {
  get y() {
    console.log("get");
    return 123;
  }
  set y(z) {
    console.log("set", z);
  }
}

let x = new X();
x.y = x.y = 1;

Steps to reproduce

compile and execute below code in both ts and as

AssemblyScript version

v0.27.x

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions