title: Illegal static interface method call
body: <p>Java-8 allows define static methods inside interface, but <a href="https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.4">restricts</a> it invocation by only interface name:</p>
  
  <blockquote>
    <p>9.4: An interface can declare static methods, which are invoked without
    reference to a particular object.</p>
  </blockquote>
  
  <p>E.g.:</p>
  
  <pre><code>interface X {
      static void y() {
      }
  }
  
  ...
  
  X x = new X() {};
  x.y();
  </code></pre>
  
  <p>causes error:</p>
  
  <pre><code>error: illegal static interface method call
          x.y();
              ^
    the receiver expression should be replaced with the type qualifier 'X'
  </code></pre>
  
  <p>Often in JLS such kind of prohibitions have an explanation. In this case I didn't found anything detailed. So I'm looking for a comprehensive or authoritative explanation of this rule: why it is prohibited to invoke static method via particular object reference? What does it break?</p>