@Override
    public DataType setInputType(DataType inputType, TypeContext context) {
        super.setInputType(inputType, DataType.STRING, context);

        DataType outputType = defaultExp == null ? null : defaultExp.setInputType(inputType, context);
        boolean outputNeverAssigned = true; // Needed to separate this null case from the "cannot be inferred" case
        for (Expression expression : cases.values()) {
            DataType expressionOutputType = expression.setInputType(inputType, context);
            outputType = outputNeverAssigned ? expressionOutputType : mostGeneralOf(outputType, expressionOutputType);
            outputNeverAssigned = false;
        }
        return outputType;
    }
The default expression, or null if none
indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/SwitchExpression.java