Wrong or misleading error reported.

Originator:matteosartori
Number:rdar://19411465 Date Originated:8.1.2015
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:Always
 
Given the code:

func foo(bar: Dictionary<Int,String>) {
    bar[3] = "Boz"
}

Xcode will give the error:
'@lvalue $T5' is not identical to '(Int,String)'

which is not (a good description of) the error. 

The error is that bar has not been prefixed with var and thus cannot be assigned to.

To reproduce:
Type the above func into an Xcode Playground.

Expected:
An error message that hints at the problem.

Actual:
An error message that confuses.

Xcode and OS versions:
Xcode Version 6.1.1 (6A2008a)
Yosemite 10.10.2 (14C81f)

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!