title: Scala Compilation Error : Value += is not member of Int
body: <p>I am at a beginner level in Scala, I am trying the following code:</p>
  
  <pre><code>var i: Int = 0
  
  for (i &lt;- 0 to 10) {
    if (i == 2) { 
       i += 1     
    }
  
    println(i)
  }
  </code></pre>
  
  <p>When I increment <code>i</code> the compiler says <code>Value += is not member of Int</code>.</p>