public ValueWithSource withVariant(Optional<DimensionValues> variant) {
        return new ValueWithSource(value, source, isUnoverridable, isQueryProfile, type, variant.orElse(null));
    }
Returns tye type of this if it refers to a query profile (not a leaf value), and it has a type
container-search/src/main/java/com/yahoo/search/query/profile/compiled/ValueWithSource.java