anchor.diff:    Iterable<TypeHelper> get _allHelpers =>
         [_typeHelpers, _coreHelpers].expand((e) => e);
   
  +  String _serializeField(FieldElement field, {String accessOverride}) {
  +    accessOverride ??= field.name;
  +    try {
  +      return _serialize(field.type, accessOverride, _nullable(field));
  +    } on UnsupportedTypeError {
  +      throw new InvalidGenerationSourceError(
  +          'Could not generate `toJson` code for '
  +          '`${friendlyNameForElement(field)}`.',
  +          todo: 'Make sure all of the types are serializable.');
  +    }
  +  }
  +
     /// [expression] may be just the name of the field or it may an expression
     /// representing the serialization of a value.
     String _serialize(DartType targetType, String expression, bool nullable) =>
  
positive.code: 
      var pairs = <String>[];
      for (var field in fields) {
        try {
          pairs.add('${_safeNameAccess(field)}: '
              '${_serialize(field.type, field.name, _nullable(field))}');
        } on UnsupportedTypeError {
          throw new InvalidGenerationSourceError(
              'Could not generate `toJson` code for `${friendlyNameForElement(field)}`.',
              todo: 'Make sure all of the types are serializable.');
        }
      }
      buffer.writeAll(pairs, ',\n');
  
  
negative.code:     return buffer.toString();
    }
  
    void _writeToJsonWithNullChecks(StringBuffer buffer,
        Iterable<FieldElement> fields, bool classIncludeIfNull) {
      buffer.writeln('{');
  
      buffer.writeln('var $toJsonMapVarName = <String, dynamic>{');
  