@Override
	protected DataType getSourceDataType() {
		Data data = getData(getLocation());
		Data parentData = getParent(data);
		DataType dataType = parentData.getDataType();
		if (!(dataType instanceof Union)) {
			throw new AssertException("A Union is required for this LocationDescriptor");
		}
		union = (Union) dataType;
		return dataType;
	}
A location descriptor to find references to a Union data type.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/locationreferences/UnionLocationDescriptor.java