@Override
	public void dataTypeDeleted(DataType dt) {
		boolean changed = false;
		int n = components.size();
		for (int i = n - 1; i >= 0; i--) {
			DataTypeComponentImpl dtc = components.get(i);
			if (dtc.isBitFieldComponent()) {
				// Do not allow bitfield to be destroyed
				// If base type is removed - revert to primitive type
				BitFieldDataType bitfieldDt = (BitFieldDataType) dtc.getDataType();
				if (bitfieldDt.getBaseDataType() == dt &&
					updateBitFieldDataType(dtc, dt, bitfieldDt.getPrimitiveBaseDataType())) {
					changed = true;
				}
			}
			else if (dtc.getDataType() == dt) {
				setComponentDataType(dtc, BadDataType.dataType, i);
				changed = true;
			}
		}
		// Should be no impact for non-packed
		if (changed && !isPackingEnabled()) {
			repack(true);
		}
	}
Replaces the internal components of this structure with components of the given structure
including packing and alignment settings.

@param dataType the structure to get the component information from.
@throws IllegalArgumentException if any of the component data types are not allowed to
            replace a component in this composite data type. For example, suppose dt1
            contains dt2. Therefore it is not valid to replace a dt2 component with dt1 since
            this would cause a cyclic dependency.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StructureDataType.java