             guard let value = _get(object) else { return nil }
             // use a type-check on ValueType instead of a type-check on the value
             // this way the optimizer can hopefully strip it out for us
-            if ValueType.self is AnyObject {
+            if ValueType.self is AnyObject.Type {
                 return unsafeBitCast(value, to: ValueType.self)
             } else {
                 let box = unsafeBitCast(value, to: _AssocValueBox<ValueType>.self)

        }
    }

    private init(_policy: objc_AssociationPolicy) {
        self._policy = _policy
    }


            // type-check the ValueType instead of the value to avoid obj-c bridging.
            // This way we'll match the expected boxing behavior of the getter.
            // Hopefully the optimizer will strip this out for us.
            if ValueType.self is AnyObject.Type {
                _set(object, newValue as AnyObject?)
            } else if let v = newValue {
                _set(object, _AssocValueBox<ValueType>(v))
            } else {
