/** {@inheritDoc} */
  @Override
  public IType getType() {

    // The type should be ignored, use the special constant
    if (ignoreType) {
      return queryContext.getTypeHelper().unknownType();
    }

    // The type name was set
    if (typeName != null) {
      return queryContext.getType(typeName);
    }

    // The calculation couldn't find an expression with a type
    if (expression == null) {
      if (type == null) {
        type = Object.class;
      }
      return queryContext.getType(type);
    }

    return queryContext.getType(expression);
  }