title: How to declare extension parameter on generic enums companions
body: <p>I'd like to have <code>.MAX</code> on generic enums to represent the values count.</p>
  
  <p>I tried to play a little but I couldn't figure it out.</p>
  
  <p>When I write, for example, this:</p>
  
  <p><code>val Enum.Companion.MAX get() = enumValues().size</code></p>
  
  <p>It complains on <code>enumValues()</code> that</p>
  
  <blockquote>
    <p>Type inference failed: Not enough information to infer parameter T in </p>
    
    <p>inline fun > enumValues
    ( )
    : Array
    Please specify it explicitly.</p>
  </blockquote>
  
  <p>It makes sense, then I tried also:</p>
  
  <p><code>val &lt;E&gt; Enum&lt;E&gt;.Companion.MAX get() = enumValues().size</code></p>
  
  <p>It complains on the second <code>E</code></p>
  
  <blockquote>
    <p>Type arguments for outer class are redundant when nested class is referenced</p>
  </blockquote>
  
  <p>Is there a way?</p>