title: Does Go compiler's evaluation differ for constant expression and other expression
body: <p>Why does below code fail to compile?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "unsafe"
  )
  
  var x int = 1
  
  const (
      ONE     int = 1
      MIN_INT int = ONE &lt;&lt; (unsafe.Sizeof(x)*8 - 1)
  )
  
  func main() {
      fmt.Println(MIN_INT)
  
  }
  </code></pre>
  
  <p>I get an error </p>
  
  <blockquote>
    <p>main.go:12: constant 2147483648 overflows int</p>
  </blockquote>
  
  <p>Above statement is correct. Yes, 2147483648 overflows int (In 32 bit architecture). But the shift operation should result in a negative value ie -2147483648. </p>
  
  <p>But the same code works, If I change the constants into variables and I get the expected output. </p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "unsafe"
  )
  
  var x int = 1
  
  var (
      ONE     int = 1
      MIN_INT int = ONE &lt;&lt; (unsafe.Sizeof(x)*8 - 1)
  )
  
  func main() {
      fmt.Println(MIN_INT)
  
  }
  </code></pre>