make declare_coercion work outside type libraries (RT#92591)