I do not believe that this is a mistake, in fact, this is how the language was designed to work:
From the Apple Stuff ( https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Methods.html#//apple_ref/doc/uid/TP40014097-CH15-XID_300 ):
class Counter { var count: Int = 0 func incrementBy(amount: Int, numberOfTimes: Int) { count += amount * numberOfTimes } }
This incrementBy method has two parameters - number and number ofOfTimes. By default, Swift treats the number as a local name, but processes numberOfTimes both the local and the external name. You call the method as follows:
let counter = Counter() counter.incrementBy(5, numberOfTimes: 3)
You do not need to define the name of the external parameter for the value of the first argument, since its purpose is clear from the name of the function incrementBy. The second argument, however, qualifies by the name of an external parameter to clear its purpose when the method is called.
This default behavior effectively handles the method as if you had a hash character (#) before the numberOfTimes parameter
In principle, for methods inside a class, the first parameter by default has only the name of the internal parameter. All subsequent default parameter names correspond to external names, where the external name is used by default. So # is redundant.
func insertFileWithService(service: GTLServiceDrive, title: String)
Is equivalent
func insertFileWithService(service: GTLServiceDrive,
For methods, not functions. That is why you get a warning.