     }
     @objc(__swift_setObject:forKeyedSubscript:)
     set {
-      // FIXME: Unfortunate that the `NSCopying` check has to be done at
-      // runtime.
-      let copyingKey = key as AnyObject as! NSCopying
+      let copyingKey = duckCastToNSCopying(key)
       if let newValue = newValue {
         self.setObject(newValue, forKey: copyingKey)
       } else {

@_exported import Foundation // Clang module
import _SwiftFoundationOverlayShims

//===----------------------------------------------------------------------===//
// Dictionaries
//===----------------------------------------------------------------------===//

  public required convenience init(
    dictionaryLiteral elements: (Any, Any)...
  ) {
    
    self.init(
      objects: elements.map { $0.1 as AnyObject },
      forKeys: elements.map { duckCastToNSCopying($0.0) },
      count: elements.count)
  }
}
