fixed safe upcast constraints