title: Getting an error when trying to move code from the Playground to its own file
body: <p>Hi guys I'm having issues trying to get this little playground to run, I mocked this up in the Playground which works fine but I'm having issues trying to get it to run in its own <code>swift</code> file</p>
  
  <pre><code>let config = URLSessionConfiguration.default
  let session = URLSession(configuration: config)
  let url = URL(string: "http://reddit.com/r/globaloffensive/new")!
  
  let task = session.dataTask(with: url, completionHandler: {
      (data, response, error) in
  
      if error != nil {
          print(error!.localizedDescription)
      } else {
          do {
              if let json = try JSONSerialization.jsonObject(with: data!, options: .allowFragments) as? [String: Any] {
                  dump(json)
              }
          } catch {
              print("Error")
          }
      }
  })
  task.resume()
  </code></pre>
  
  <p>I'm mainly trying to figure out how to make API calls, but when I run this in its own file and run</p>
  
  <p><code>swift run test.swift</code> I get</p>
  
  <pre><code>test.swift:1:14: error: use of unresolved identifier 'URLSessionConfiguration'
  let config = URLSessionConfiguration.default
               ^~~~~~~~~~~~~~~~~~~~~~~
  test.swift:2:15: error: use of unresolved identifier 'URLSession'
  let session = URLSession(configuration: config)
                ^~~~~~~~~~
  test.swift:3:11: error: use of unresolved identifier 'URL'
  let url = URL(string: "http://reddit.com/r/globaloffensive/new")!
            ^~~
  </code></pre>
  
  <p>Any information would be great thanks.</p>