private static DataType resolveOutputType(List<DataType> types) {
        DataType resolved = null;
        for (DataType type : types) {
            if (type == null) return null;
            if (!(type instanceof CollectionDataType)) return DataType.STRING;

            if (resolved == null)
                resolved = type;
            else if (!resolved.isAssignableFrom(type))
                return DataType.STRING;
        }
        return resolved;
    }
We're either concatenating strings, or collections.
indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/CatExpression.java