Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: X10 1.7.2 - C++ hosted, X10 1.7.3, X10 2.0.2
-
Component/s: Managed X10: Compiler Codegen, Native X10: Compiler Codegen
-
Labels:None
-
Number of attachments :
Description
public class Bug { static class A { val name1 = className(); def name2() = className(); } static class B extends A {} public static def main(Rail[String]) { System.out.println("name1 " + new B().name1); System.out.println("name2 " + new B().name2()); } }
java:
name1 class Bug$B
name2 class Bug$B
c++:
name1 Bug$A
name2 Bug$B
Two differences:
1. Preceded by "class" in Java, not in C++
2. Virtual in methods, not virtual in field initializers in C++. My expectation is it should be consistent, and virtual, as in Java.
Java gets it wrong: className() should not be preceded by "class". Please open a JIRA issue for that. Investigating the virtual vs. non-virtual business.