public static ItemType promote(ItemType v1, ItemType v2, TypeHierarchy typeHierarchy) {
        ItemType t1 = (typeHierarchy.isSubType(v1, BuiltInAtomicType.NUMERIC) ? v1 : BuiltInAtomicType.DOUBLE);
        ItemType t2 = (typeHierarchy.isSubType(v2, BuiltInAtomicType.NUMERIC) ? v2 : BuiltInAtomicType.DOUBLE);

        if (t1 == t2) return t1;

        if (t1.equals(BuiltInAtomicType.DOUBLE) || t2.equals(BuiltInAtomicType.DOUBLE)) {
            return BuiltInAtomicType.DOUBLE;
        }

        if (t1.equals(BuiltInAtomicType.FLOAT) || t2.equals(BuiltInAtomicType.FLOAT)) {
            return BuiltInAtomicType.FLOAT;
        }

        if (t1.equals(BuiltInAtomicType.DECIMAL) || t2.equals(BuiltInAtomicType.DECIMAL)) {
            return BuiltInAtomicType.DECIMAL;
        }

        return BuiltInAtomicType.INTEGER;
    }