Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: X10 1.7.2 - C++ hosted
-
Fix Version/s: X10 1.7.3
-
Component/s: Native X10: Compiler Codegen
-
Labels:None
-
Number of attachments :
Description
value V {}
public class Bug {
public static def main(var args: Rail[String]): void = {
val v = new V();
x10.runtime.NativeRuntime.println(v.equals(v).toString());
}
}
outputs false.
Issue Links
- is depended upon by
-
XTENLANG-309
C++ version of examples/Constructs/GC/RemoteRef.x10 fails with exception in Clock_c register_c
-
v == v checks the pointers, i.e. is broken since new V() != new V()
v.equals(v) is broken because value V does not have a ::equals method, thus inherits Value::equals which only returns true when given another concrete instance of Value
We should generate a .equals for every value that looks like this
Alternatively we can try and write a general equals() inside Value that uses memcmp, but that will mean new V() == new Value() and we will also have to memset to 0 on allocation to make sure all padding is 0