title: What "a constant index that is untyped is given type int" means?
body: <p><a href="https://golang.org/ref/spec#Index_expressions" rel="nofollow noreferrer">Go specification</a> gives the rules for index expression <code>a[x]</code>:</p>
  <blockquote>
  <p>If <code>a</code> is not a map:</p>
  <ul>
  <li>the index x must be of integer type or an untyped constant</li>
  <li>a constant index must be non-negative and representable by a value of type int</li>
  <li>a constant index that is untyped is given type int</li>
  <li>the index x is in range if 0 &lt;= x &lt; len(a), otherwise it is out of range</li>
  </ul>
  </blockquote>
  <p>What does exactly the third rule (a constant index that is untyped is given type int ) mean? Doesn't a valid expression <code>a[1.0]</code> contradict that rule?</p>