private boolean checkTypeExprent(Exprent exprent) {

    for (Exprent expr : exprent.getAllExprents()) {
      if (!checkTypeExprent(expr)) {
        return false;
      }
    }

    if (exprent.type == Exprent.EXPRENT_CONST) {
      ConstExprent constExpr = (ConstExprent)exprent;
      if (constExpr.getConstType().typeFamily <= CodeConstants.TYPE_FAMILY_INTEGER) { // boolean or integer
        VarVersionPair pair = new VarVersionPair(constExpr.id, -1);
        if (!mapExprentMinTypes.containsKey(pair)) {
          mapExprentMinTypes.put(pair, constExpr.getConstType());
        }
      }
    }

    CheckTypesResult result = exprent.checkExprTypeBounds();

    for (CheckTypesResult.ExprentTypePair entry : result.getLstMaxTypeExprents()) {
      if (entry.type.typeFamily != CodeConstants.TYPE_FAMILY_OBJECT) {
        changeExprentType(entry.exprent, entry.type, 1);
      }
    }

    boolean res = true;
    for (CheckTypesResult.ExprentTypePair entry : result.getLstMinTypeExprents()) {
      res &= changeExprentType(entry.exprent, entry.type, 0);
    }

    return res;
  }