Xcode6-Beta2 (6A216f): No autocompletion for type parameters in function definitions

Originator:rix.rob
Number:rdar://17489586 Date Originated:27-Jun-2014 05:24 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode6-Beta2 (6A216f)
Classification:Serious Bug Reproducible:Always
 
Summary:
There is no autocompletion when implementing a generic function.


Steps to Reproduce:
1. Implement a generic function such as identity:

func identity<Thing>(a: Thing) -> Thing { return a }

2. When typing out the type of the parameter or of the return value, attempt to invoke autocompletion in Xcode.


Expected Results:
I expected that Xcode would autocomplete the name of the type from the function’s type parameter list.


Actual Results:
It did not.


Regression:
N/A


Notes:
Lacking this feature encourages the use of single-letter type parameters, which is an antipattern in many cases. Swift’s definition of Dictionary uses the explanatory type parameter names KeyType and ValueType, which is wonderful, but it’s harder to type that without autocompletion than Dictionary<K, V> would have been.

Since type parameters are just parameters, I think this should behave the same way as Xcode behaves w.r.t. autocompletion of the parameter names themselves.

This should also apply in the body of the function, if there are types being instantiated or otherwise referenced therein.

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!