Inaccessible Matching Constructors or Methods (IMCM)

Description:

IMCM detects if the overload resolution only considers constructors and methods visible at the point of the call. If, however, all the constructors and methods were considered, there may be more matches. This rule is violated in this case.

Imagine that ClassB is in a different package than ClassA. Then the allocation of ClassB violates this rule, because the second constructor is not visible at the point of the allocation, but it still matches the allocation (based on signature). Also, the call to oper in ClassB violates this rule, because the second and third declarations of oper are not visible at the point of the call, but they still match the call (based on signature).

Example:

public class ClassA {
	public ClassA (int param) {}
    ClassA (char param) {} 
    ClassA (short param) {} 
    public void oper (int param) {}
    void oper (char param) {} 
    void oper (short param) {} 
}