anchor.diff:    }
   
     // Emit expression with unary operator: (~(x))
  -  void emitUnaryExpr(int depth, DartType tp) {
  +  void emitUnaryExpr(int depth, DartType tp, {RhsFilter rhsFilter}) {
       if (tp == DartType.BOOL || tp == DartType.INT || tp == DartType.DOUBLE) {
         emit('(');
         emitUnaryOp(tp);
         emit('(');
  -      emitExpr(depth + 1, tp);
  +      emitExpr(depth + 1, tp, rhsFilter: rhsFilter);
         emit('))');
       } else {
  -      emitTerminal(depth, tp); // resort to terminal
  +      emitTerminal(depth, tp, rhsFilter: rhsFilter); // resort to terminal
       }
     }
   
     // Emit expression with binary operator: (x + y)
  -  void emitBinaryExpr(int depth, DartType tp) {
  +  void emitBinaryExpr(int depth, DartType tp, {RhsFilter rhsFilter}) {
       if (tp == DartType.BOOL) {
         // For boolean, allow type switch with relational op.
         if (rand.nextInt(2) == 0) {
           DartType deeper_tp = getType();
           emit('(');
  -        emitExpr(depth + 1, deeper_tp);
  +        emitExpr(depth + 1, deeper_tp, rhsFilter: rhsFilter);
           emitRelOp(deeper_tp);
  -        emitExpr(depth + 1, deeper_tp);
  +        emitExpr(depth + 1, deeper_tp, rhsFilter: rhsFilter);
           emit(')');
           return;
         }
  -    } else if (tp == DartType.STRING || tp == DartType.INT_LIST) {
  -      // For strings and lists, a construct like x = x + x; inside a loop
  -      // yields an exponentially growing data structure. We avoid this
  -      // situation by forcing a literal on the rhs of each +.
  -      emit('(');
  -      emitExpr(depth + 1, tp);
  -      emitBinaryOp(tp);
  -      emitLiteral(depth + 1, tp);
  -      emit(')');
  -      return;
       }
       emit('(');
  -    emitExpr(depth + 1, tp);
  +    emitExpr(depth + 1, tp, rhsFilter: rhsFilter);
       emitBinaryOp(tp);
  -    emitExpr(depth + 1, tp);
  +    emitExpr(depth + 1, tp, rhsFilter: rhsFilter);
       emit(')');
     }
   
     // Emit expression with ternary operator: (b ? x : y)
  -  void emitTernaryExpr(int depth, DartType tp) {
  +  void emitTernaryExpr(int depth, DartType tp, {RhsFilter rhsFilter}) {
       emit('(');
  -    emitExpr(depth + 1, DartType.BOOL);
  +    emitExpr(depth + 1, DartType.BOOL, rhsFilter: rhsFilter);
       emit(' ? ');
  -    emitExpr(depth + 1, tp);
  +    emitExpr(depth + 1, tp, rhsFilter: rhsFilter);
       emit(' : ');
  -    emitExpr(depth + 1, tp);
  +    emitExpr(depth + 1, tp, rhsFilter: rhsFilter);
       emit(')');
     }
   
     // Emit expression with pre/post-increment/decrement operator: (x++)
  -  void emitPreOrPostExpr(int depth, DartType tp) {
  +  void emitPreOrPostExpr(int depth, DartType tp, {RhsFilter rhsFilter}) {
       if (tp == DartType.INT) {
         int r = rand.nextInt(2);
         emit('(');
  
positive.code:         ' <<= ',
          ' ??= ',
          ' = '
        ]));
      } else if (tp == DartType.DOUBLE) {
        emit(oneOf(
            const <String>[' += ', ' -= ', ' *= ', ' /= ', ' ??= ', ' = ']));
      } else {
        emit(oneOf(const <String>[' ??= ', ' = ']));
      }
    }
  
  
negative.code:       emit('(');
        if (proto[1] != 'V') {
          for (int i = 1; i < proto.length; i++) {
            emitArg(depth + 1, proto[i], rhsFilter: rhsFilter);
            if (i != (proto.length - 1)) {
              emit(', ');
            }
  