Fix Trac #3391: make generic to/from bindings only for newly-declared types