assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

Operator overload

Open HerrCai0907 opened this issue 2 years ago • 1 comments

new A() == new B() and new B() == new A() will call different operator overload functions if both A and B have overload function declarations.

It needs more clear rules to handle it. In my opinion there are two solutions:

  1. Diagnose when confused overload resolution.
  2. Define priorities and do overload resolution according to priorities.

HerrCai0907 avatar Oct 08 '23 02:10 HerrCai0907

Number one seems more plausible, since a cast would fix it.

CountBleck avatar Oct 08 '23 02:10 CountBleck