     }
     
     public static func resolve<D, C: Hashable, N: Hashable>(container: C, name: N, parameter: Any = (), lifecycle: Lifecycle = .cached) -> D? {
-        let key = Key(type: String(reflecting: D.self), container: container, name: name)
+        let key = Key(type: D.self, container: container, name: name)
         return resolve(key: key, parameter: parameter, lifecycle: lifecycle)
     }
     

    case once
}

public struct Key: Hashable, Equatable {
    fileprivate let type: String
    fileprivate let name: AnyHashable
    fileprivate let container: AnyHashable
    
    init<C: Hashable, N: Hashable>(type: String, container: C, name: N) {
        self.type = type
        self.name = name
        self.container = container
        // djb2 hash algorithm: http://www.cse.yorku.ca/~oz/hash.html
        // &+ operator handles Int overflow
        var hash = 5381
        hash = ((hash << 5) &+ hash) &+ type.hashValue
        hash = ((hash << 5) &+ hash) &+ container.hashValue
        hash = ((hash << 5) &+ hash) &+ name.hashValue
        hashValue = hash
    }
    
    init<P, D, C: Hashable, N: Hashable>(container: C, name: N, resolve: (P) -> D) {
        self.init(type: String(reflecting: D.self), container: container, name: name)
    }
    
    public let hashValue: Int

        return Guise.register(container: Container.default, name: Name.default, lifecycle: lifecycle, resolve: resolve)
    }

    public func resolve<D>(key: Key, parameter: Any = (), lifecycle: Lifecycle = .cached) -> D? {
        return Guise.resolve(key: key, parameter: parameter, lifecycle: lifecycle)
    }
    
    public func resolve<D, C: Hashable, N: Hashable>(container: C, name: N, parameter: Any = (), lifecycle: Lifecycle = .cached) -> D? {
        let key = Key(type: D.self, container: container, name: name)
        return Guise.resolve(key: key, parameter: parameter, lifecycle: lifecycle)
    }
    
    public func resolve<D, C: Hashable>(container: C, parameter: Any = (), lifecycle: Lifecycle = .cached) -> D? {
        return Guise.resolve(container: container, name: Name.default, parameter: parameter, lifecycle: lifecycle)
    }
    
    public func resolve<D, N: Hashable>(name: N, parameter: Any = (), lifecycle: Lifecycle = .cached) -> D? {
        return Guise.resolve(container: Container.default, name: name, parameter: parameter, lifecycle: lifecycle)
    }
    
    public func resolve<D>(parameter: Any = (), lifecycle: Lifecycle = .cached) -> D? {
        return Guise.resolve(container: Container.default, name: Name.default, parameter: parameter, lifecycle: lifecycle)
    }

}
