JDK-8238213: javac emits wrong error when calling an non-static overloaded method from static

B. Blaser bsrbnd at gmail.com
Thu Oct 8 09:44:32 UTC 2020

Testing a few more, I note that a discrepancy with the JLS in this
area might have deeper consequences beyond wrong diagnostics,

public class Test {
  public static void main(String[] args) {

  void test(Number n) {

  static void test(Double... d) {

JDK16 currently resolves and runs 'test(Double...)' instead of raising
a static error as mandated by §15.12 and according to the suggested
I'm not sure where to find JDK7 x86_64 binaries, so maybe you could
try this one too and share your thoughts?


On Mon, 5 Oct 2020 at 12:00, Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
> Thanks - I've reset the fix version field and reassigned to Vicente - he
> can perhaps take a look and see what needs to be done to integrate this
> (this is an area where we would at least need some good testing
> coverage, perhaps by using the overload test framework that was put in
> few years ago - see [1] for an example).
> Maurizio
> [1] -
> https://github.com/openjdk/jdk/blob/master/test/langtools/tools/javac/resolve/tests/InnerOverOuter.java

More information about the compiler-dev mailing list