Inference upon mapreduce

Just by curiosity, I was asking myself if the incapability of the compiler to make type-stabile this function

function _trykeepnames(dicts)
    ktype = mapreduce(keytype, promote_type, dicts)
    vtype = mapreduce(valtype, promote_type, dicts)
    d1 = first(dicts)
    return all(==(d1), dicts) ? OrderedDict{ktype, vtype}(d1) : OrderedDict{ktype, vtype}(defaultnamesdict(length(d1)))

is a matter of not having implemented yet a specialized mapreduce(::typeof(typeof), ::typeof(promote_type), ...) or there is an’intrinsic problem in doing such a thing.

Ops, I was wrong, inference was ok, the problem was an inconsistent function :sweat_smile: