Swift: error subscripting classes using certain named tuple parameters

Originator:michaeltackes
Number:rdar://21166749 Date Originated:29-May-2015 05:29 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Version 6.3.2 (6D2105)
Classification: Reproducible:Always
 
Summary:
The compiler gives an error ("extraneous argument label '<name>:' in subscript") when attempting to add to a class a subscripting setter where the first argument has no external name and is a tuple with a named member in position zero as a parameter.

Steps to Reproduce:
1. Create a class in Swift
2. Add a subscript
  a. that has a first parameter with no external name
  b. which is a tuple having a named zeroth member (e.g., `(a: Int, Int)`)
3. Notice the error when attempting to build (error does not show up inline in Xcode)

Expected Results:
Code builds and runs.

Actual Results:
Build error ("extraneous argument label '<name>:' in subscript").

Version:
Version 6.3.2 (6D2105)

Minimal Example:
class GetSet {
  subscript(position: (x: Int, y: Int)) -> Int {
    get { return 0 }
    set { }
  }
}

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!