Xcode-beta (7A121l): Single value generic methods are implicitly wrapping multiple values as a tuple

Originator:owensd
Number:rdar://21577729 Date Originated:26-Jun-2015 10:48 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (7A121l)
Classification:Serious Bug Reproducible:Always
 
Take these two function definitions and code examples:

func f<T>(value: T) {
    print("value: \(value)")
}

func f<T>(value: T, hi: Int) {
    print("value: \(value) \(hi)")
}

f("hi")
f("hi", append: false)
f("hi", append: false, omg: "what?")

f("hi", hi: 12)  // calls f(value: T, hi: Int)
f("hi", Hi: 12) // calls f(value: T)

This code should not compile. Unwrapped values in the method signature should not be getting auto-promoted into a tuple. This is terribly confusing and was the source of this bug: http://www.openradar.me/21577485

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!