     }
 }
 
-extension Sequence where Iterator.Element == AnyKey {
-    public func typed<T>() -> Set<Key<T>> {
+extension Sequence where Iterator.Element: Keyed {
+    public func typedKeys<T>() -> Set<Key<T>> {
         return Set<Key<T>>(flatMap{ Key($0) })
+    }
+    
+    public func untypedKeys() -> Set<AnyKey> {
+        return Set(map{ AnyKey($0) })
     }
 }
 

    }
    
    /**
    */
    public static  func filter<T>(key: Key<T>) -> Set<Key<T>> {
        return lock.read{ registrations[AnyKey(key)] == nil ? [] : [key] }

    /**
     Retrieve metadata for the dependency registered under `key`.
    */
    public static func metadata<M>(for key: Keyed) -> M? {
        return lock.read {
            guard let dependency = registrations[AnyKey(key)] else { return nil }
            guard let metadata = dependency.metadata as? M else { return nil }
            return metadata
        }
