Swift function internal parameter name cannot match the name of a type

Originator:steve_w101
Number:rdar://27059887 Date Originated:28-Jun-2016 07:25 PM
Status:Open Resolved:
Product:Developer Tools Product Version:7.3.1, 8.0
Classification:Other Bug Reproducible:Always
 
Summary:
An internal parameter name of a Swift function cannot match the name of a type.

Steps to Reproduce:
Open the attached Xcode playground.
Alternatively create one with the following code:

mport Foundation

protocol Fetchable {
  
  func fetchSomething(from URL: URL)
  
}

class Fetcher: Fetchable {
  
  func fetchSomething(from URL: URL) {
    
  }
  
}

Expected Results:
The code compiles / playground executes successfully.

Actual Results:
An error is generated due to the implementation of the fetchSomething(from:) function, stating “Use of undeclared type ‘URL’”.

Version:
Tested and confirmed to occur under Xcode 8 (8S128d) with Swift 3, and Xcode 7.3.1 (7D1014) with Swift 2.2

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!