Can't call methods using a tuple literal on a generic struct with tuple type

Originator:natecook
Number:rdar://18479355 Date Originated:9/27/2014
Status:Open Resolved:
Product:Xcode Product Version:6.1 beta 2
Classification:Serious bug Reproducible:Always
 
This appears to be the reason behind this never working:

    var array = [(1, 2), (3, 4)]
    array.append((5, 6))
    // error: missing argument for parameter #2 in call

When generic structs are specialized with a tuple type, methods can't be called with a literal of that instance's specialized type. Those same methods can be called with a tuple variable. Methods that explicitly accept a tuple don't have an issue -- they accept both tuple literals and tuple variables.

Steps to Reproduce:
1. Open Xcode
2. Create a new playground
3. Enter the following code:

struct TestGeneric<T> {
    func goodMethod(arg: (Int, Int)) {
        println(arg)
    }
    
    func badMethod(arg: T) {
        println(arg)
    }
}

var test = TestGeneric<(Int, Int)>()
let tuple = (1, 2)
test.goodMethod(tuple)
test.goodMethod((3, 4))
test.badMethod(tuple)
test.badMethod((3, 4))      // this is the line that fails


Expected Results:
The console should show:

(1, 2)
(3, 4)
(1, 2)
(3, 4)

Actual Results:
The console shows an error message:

Playground execution failed: <EXPR>:38:16: error: missing argument for parameter #2 in call
test.badMethod((3, 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!