title: Why do we allow referring to an enum member of an enum member in Java?
body: <p>Given the following enum:</p>
  
  <pre><code>enum Repeat {
      Daily,
      Weekly,
      Yearly
  }
  </code></pre>
  
  <p>I realize we are able to write it this way:</p>
  
  <pre><code>Repeat repeat = Repeat.Daily.Weekly.Yearly.Weekly;
  </code></pre>
  
  <p>which is equivalent to:</p>
  
  <pre><code>Repeat repeat = Repeat.Weekly;
  </code></pre>
  
  <p>May I know why such syntax is allowed? Is there a way to let the compiler warn us against this?</p>