Stable way to prevent moving out of a type

Relatedly, there's this recently-posted neat trick to make an object not movable: