[linker] keep types in the module when sweeping them