title: Swift / Spring - Ambiguous reference to member 'subscript'
body: <p>My 2nd question on here and it's Spring related yet again, your assistance is greatly appreciated.</p>
  
  <p>Here is the line of code that receives the issue code:</p>
  
  <pre><code>var soundID : SystemSoundID = Internal.cache[url] ?? 0
  </code></pre>
  
  <p>and </p>
  
  <pre><code>Internal.cache[url] = soundID
  </code></pre>
  
  <p>Issue Code:</p>
  
  <pre><code>Ambiguous reference to member 'subscript'
  </code></pre>
  
  <p>Additional Code:</p>
  
  <pre><code>struct SoundPlayer {
  
  static var filename : String?
  static var enabled : Bool = true
  
  private struct Internal {
      static var cache = [NSURL:SystemSoundID]()
  }
  
  static func playSound(soundFile: String) {
  
      if !enabled {
          return
      }
  
      if let url = Bundle.main.url(forResource: soundFile, withExtension: nil) {
  
          var soundID : SystemSoundID = Internal.cache[url] ?? 0
  
          if soundID == 0 {
              AudioServicesCreateSystemSoundID(url as CFURL, &amp;soundID)
              Internal.cache[url] = soundID
          }
  
          AudioServicesPlaySystemSound(soundID)
  
      } else {
          print("Could not find sound file name `\(soundFile)`")
      }
  }
  
  static func play(file: String) {
      self.playSound(soundFile: file)
  }
  </code></pre>
  
  <p>}</p>