private void assertConsistentTypes(SummaryField existing, SummaryField seen) {
        if (existing.getDataType() instanceof WeightedSetDataType &&
            seen.getDataType() instanceof WeightedSetDataType &&
            existing.getDataType().getNestedType().equals(seen.getDataType().getNestedType()))
            return; // Disregard create-if-nonexistent and create-if-zero distinction
        if ( ! compatibleTypes(seen.getDataType(), existing.getDataType()))
            throw new IllegalArgumentException(existing.toLocateString() + " is inconsistent with " + 
                                               seen.toLocateString() + ": All declarations of the same summary field must have the same type");
    }
Ensure that summary field transforms for fields having the same name
are consistent across summary classes

@author bratseth
config-model/src/main/java/com/yahoo/schema/processing/SummaryConsistency.java