Extracted from #45638 When adding the "detectable" tag to a package class that has the "tag" attribute inherited from a base class, we need to copy it to avoid modifying the base class.