Identity assignments are compiler errors

Originator:m.mayer6
Number:rdar://21976169 Date Originated:150723
Status:Open Resolved:No
Product:Developer Tools Product Version:Xcode 7, beta 4
Classification:Other Bug Reproducible:Always
 
Summary:
When entering code:
var i = 0
i = i      <--- compiler gives error: Assigning variable to itself
I believe the Swift language allows this, but the compiler issues an error rather than a warning

Steps to Reproduce:
// Enter code:
var i: Int = 0
i = i      
// compiler gives error: "Assigning variable to itself"

Expected Results:
Compiler should give warning: 
"Warning: Assigning variable to itself"

Actual Results:
Compiler gives error: "Assigning variable to itself"

Version:
Xcode 7, Beta 4 & OSX 10.10.4

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!