The following code compiles just fine with our compiler, but fails in MS J++
public class Construct {
public Construct(){}
public void Construct(){}
}
Obviously, the first is a constructor, the second is a method.
However, I was unable to find the section of the JLS that specifies that constructor and method namespaces are separate. In fact, it is implied that they are the same.
So, either I completely missed the section that discusses constructor naming issues, or either the spec or our compiler need to change.
public class Construct {
public Construct(){}
public void Construct(){}
}
Obviously, the first is a constructor, the second is a method.
However, I was unable to find the section of the JLS that specifies that constructor and method namespaces are separate. In fact, it is implied that they are the same.
So, either I completely missed the section that discusses constructor naming issues, or either the spec or our compiler need to change.
- duplicates
-
JDK-4128179 # Add a lint-like facility to javac
-
- Closed
-