Sets an object context value.
The object's concrete type must match the type registered for `key`.
a registered object key
the new object value