diff --git a/perf/bench/SampleTypes.cs b/perf/bench/SampleTypes.cs index 08f91d0e..3e491de5 100644 --- a/perf/bench/SampleTypes.cs +++ b/perf/bench/SampleTypes.cs @@ -58,7 +58,7 @@ public partial record Location public partial record LocationWrap : IDeserialize { - private static readonly TypeInfo s_fieldMap = TypeInfo.Create([ + private static readonly TypeInfo s_fieldMap = TypeInfo.Create(TypeInfo.TypeKind.CustomType, [ ("id", typeof(Location).GetProperty("Id")!), ("address1", typeof(Location).GetProperty("Address1")!), ("address2", typeof(Location).GetProperty("Address2")!), diff --git a/src/generator/Generator.SerdeTypeInfo.cs b/src/generator/Generator.SerdeTypeInfo.cs index 905a1619..d3c709f9 100644 --- a/src/generator/Generator.SerdeTypeInfo.cs +++ b/src/generator/Generator.SerdeTypeInfo.cs @@ -103,7 +103,9 @@ internal static class SerdeTypeInfoGenerator var newType = $$""" internal static class {{typeName}}SerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { {{string.Join("," + Environment.NewLine, fieldsAndProps.Select(x => $@"(""{x.GetFormattedName()}"", typeof({typeString}).Get{(x.Symbol.Kind == SymbolKind.Field ? "Field" : "Property")}(""{x.Name}"")!)"))}} }); diff --git a/src/serde/IDeserialize.cs b/src/serde/IDeserialize.cs index b4be5776..91d35fcb 100644 --- a/src/serde/IDeserialize.cs +++ b/src/serde/IDeserialize.cs @@ -57,6 +57,14 @@ public interface IDeserializeVisitor T VisitNotNull(IDeserializer d) => throw new InvalidOperationException("Expected type " + ExpectedTypeName); } + public interface IDeserializeCollection + { + int? SizeOpt { get; } + + bool TryReadValue(TypeInfo typeInfo, [MaybeNullWhen(false)] out T next) + where D : IDeserialize; + } + public interface IDeserializeEnumerable { bool TryGetNext([MaybeNullWhen(false)] out T next) @@ -93,126 +101,6 @@ public interface IDeserializeType V ReadValue(int index) where D : IDeserialize; } - /// - /// TypeInfo holds a variety of indexed information about a type. The most important is a map - /// from field names to int indices. This is an optimization for deserializing types that avoids - /// allocating strings for field names. - /// - /// It can also be used to get the custom attributes for a field. - /// - public sealed class TypeInfo - { - // The field names are sorted by the Utf8 representation of the field name. - private readonly ImmutableArray<(ReadOnlyMemory Utf8Name, int Index)> _nameToIndex; - private readonly ImmutableArray _indexToInfo; - - private TypeInfo( - ImmutableArray<(ReadOnlyMemory, int)> nameToIndex, - ImmutableArray indexToInfo) - { - _nameToIndex = nameToIndex; - _indexToInfo = indexToInfo; - } - - /// - /// Holds information for a field or property in the given type. - /// - private readonly record struct PrivateFieldInfo(IList CustomAttributesData); - - - private static readonly UTF8Encoding s_utf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); - - /// - /// Create a new field mapping. The ordering of the fields is important -- it - /// corresponds to the index returned by . - /// - public static TypeInfo Create( - ReadOnlySpan<(string SerializeName, MemberInfo MemberInfo)> fields) - { - var nameToIndexBuilder = ImmutableArray.CreateBuilder<(ReadOnlyMemory Utf8Name, int Index)>(fields.Length); - var indexToInfoBuilder = ImmutableArray.CreateBuilder(fields.Length); - for (int index = 0; index < fields.Length; index++) - { - var (serializeName, memberInfo) = fields[index]; - if (memberInfo is null) - { - throw new ArgumentNullException(serializeName); - } - - nameToIndexBuilder.Add((s_utf8.GetBytes(serializeName), index)); - var fieldInfo = new PrivateFieldInfo(memberInfo.GetCustomAttributesData()); - indexToInfoBuilder.Add(fieldInfo); - } - - nameToIndexBuilder.Sort((left, right) => - left.Utf8Name.Span.SequenceCompareTo(right.Utf8Name.Span)); - - return new TypeInfo(nameToIndexBuilder.ToImmutable(), indexToInfoBuilder.ToImmutable()); - } - - /// - /// Returns an index corresponding to the location of the field in the original - /// ReadOnlySpan passed during creation of the . This can be - /// used as a fast lookup for a field based on its UTF-8 name. - /// - public int TryGetIndex(Utf8Span utf8FieldName) - { - int mapIndex = BinarySearch(_nameToIndex.AsSpan(), utf8FieldName); - - return mapIndex < 0 ? IDeserializeType.IndexNotFound : _nameToIndex[mapIndex].Index; - } - - public IList GetCustomAttributeData(int index) - { - return _indexToInfo[index].CustomAttributesData; - } - - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private static int BinarySearch(ReadOnlySpan<(ReadOnlyMemory, int)> span, Utf8Span fieldName) - { - return BinarySearch(ref MemoryMarshal.GetReference(span), span.Length, fieldName); - } - - // This is a copy of the BinarySearch method from System.MemoryExtensions. - // We can't use that version because ref structs can't yet be substituted for type arguments. - private static int BinarySearch(ref (ReadOnlyMemory Utf8Name, int) spanStart, int length, Utf8Span fieldName) - { - int lo = 0; - int hi = length - 1; - // If length == 0, hi == -1, and loop will not be entered - while (lo <= hi) - { - // PERF: `lo` or `hi` will never be negative inside the loop, - // so computing median using uints is safe since we know - // `length <= int.MaxValue`, and indices are >= 0 - // and thus cannot overflow an uint. - // Saves one subtraction per loop compared to - // `int i = lo + ((hi - lo) >> 1);` - int i = (int)(((uint)hi + (uint)lo) >> 1); - - int c = fieldName.SequenceCompareTo(Unsafe.Add(ref spanStart, i).Utf8Name.Span); - if (c == 0) - { - return i; - } - else if (c > 0) - { - lo = i + 1; - } - else - { - hi = i - 1; - } - } - // If none found, then a negative number that is the bitwise complement - // of the index of the next element that is larger than or, if there is - // no larger element, the bitwise complement of `length`, which - // is `lo` at this point. - return ~lo; - } - } - public interface IDeserializer { T DeserializeAny(IDeserializeVisitor v); @@ -235,6 +123,7 @@ public interface IDeserializer T DeserializeEnumerable(IDeserializeVisitor v); T DeserializeDictionary(IDeserializeVisitor v); T DeserializeNullableRef(IDeserializeVisitor v); + IDeserializeCollection DeserializeCollection(TypeInfo typeInfo) => throw new NotImplementedException(); IDeserializeType DeserializeType(TypeInfo typeInfo) => throw new NotImplementedException(); } } \ No newline at end of file diff --git a/src/serde/TypeInfo.cs b/src/serde/TypeInfo.cs new file mode 100644 index 00000000..ad9878f1 --- /dev/null +++ b/src/serde/TypeInfo.cs @@ -0,0 +1,145 @@ + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace Serde; + +/// +/// TypeInfo holds a variety of indexed information about a type. The most important is a map +/// from field names to int indices. This is an optimization for deserializing types that avoids +/// allocating strings for field names. +/// +/// It can also be used to get the custom attributes for a field. +/// +public sealed class TypeInfo +{ + public enum TypeKind + { + Primitive, + CustomType, + Enumerable, + Dictionary, + } + + public TypeKind Kind { get; } + + /// + /// Returns an index corresponding to the location of the field in the original + /// ReadOnlySpan passed during creation of the . This can be + /// used as a fast lookup for a field based on its UTF-8 name. + /// + public int TryGetIndex(Utf8Span utf8FieldName) + { + int mapIndex = BinarySearch(_nameToIndex.AsSpan(), utf8FieldName); + + return mapIndex < 0 ? IDeserializeType.IndexNotFound : _nameToIndex[mapIndex].Index; + } + + public IList GetCustomAttributeData(int index) + { + return _indexToInfo[index].CustomAttributesData; + } + + /// + /// Create a new field mapping. The ordering of the fields is important -- it + /// corresponds to the index returned by . + /// + public static TypeInfo Create( + TypeKind typeKind, + ReadOnlySpan<(string SerializeName, MemberInfo MemberInfo)> fields) + { + var nameToIndexBuilder = ImmutableArray.CreateBuilder<(ReadOnlyMemory Utf8Name, int Index)>(fields.Length); + var indexToInfoBuilder = ImmutableArray.CreateBuilder(fields.Length); + for (int index = 0; index < fields.Length; index++) + { + var (serializeName, memberInfo) = fields[index]; + if (memberInfo is null) + { + throw new ArgumentNullException(serializeName); + } + + nameToIndexBuilder.Add((s_utf8.GetBytes(serializeName), index)); + var fieldInfo = new PrivateFieldInfo(memberInfo.GetCustomAttributesData()); + indexToInfoBuilder.Add(fieldInfo); + } + + nameToIndexBuilder.Sort((left, right) => + left.Utf8Name.Span.SequenceCompareTo(right.Utf8Name.Span)); + + return new TypeInfo(typeKind, nameToIndexBuilder.ToImmutable(), indexToInfoBuilder.ToImmutable()); + } + + #region Private implementation details + + // The field names are sorted by the Utf8 representation of the field name. + private readonly ImmutableArray<(ReadOnlyMemory Utf8Name, int Index)> _nameToIndex; + private readonly ImmutableArray _indexToInfo; + + /// + /// Holds information for a field or property in the given type. + /// + private readonly record struct PrivateFieldInfo(IList CustomAttributesData); + + private static readonly UTF8Encoding s_utf8 = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); + + private TypeInfo( + TypeKind typeKind, + ImmutableArray<(ReadOnlyMemory, int)> nameToIndex, + ImmutableArray indexToInfo) + { + Kind = typeKind; + _nameToIndex = nameToIndex; + _indexToInfo = indexToInfo; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static int BinarySearch(ReadOnlySpan<(ReadOnlyMemory, int)> span, Utf8Span fieldName) + { + return BinarySearch(ref MemoryMarshal.GetReference(span), span.Length, fieldName); + } + + // This is a copy of the BinarySearch method from System.MemoryExtensions. + // We can't use that version because ref structs can't yet be substituted for type arguments. + private static int BinarySearch(ref (ReadOnlyMemory Utf8Name, int) spanStart, int length, Utf8Span fieldName) + { + int lo = 0; + int hi = length - 1; + // If length == 0, hi == -1, and loop will not be entered + while (lo <= hi) + { + // PERF: `lo` or `hi` will never be negative inside the loop, + // so computing median using uints is safe since we know + // `length <= int.MaxValue`, and indices are >= 0 + // and thus cannot overflow an uint. + // Saves one subtraction per loop compared to + // `int i = lo + ((hi - lo) >> 1);` + int i = (int)(((uint)hi + (uint)lo) >> 1); + + int c = fieldName.SequenceCompareTo(Unsafe.Add(ref spanStart, i).Utf8Name.Span); + if (c == 0) + { + return i; + } + else if (c > 0) + { + lo = i + 1; + } + else + { + hi = i - 1; + } + } + // If none found, then a negative number that is the bitwise complement + // of the index of the next element that is larger than or, if there is + // no larger element, the bitwise complement of `length`, which + // is `lo` at this point. + return ~lo; + } + + #endregion // Private implementation details +} diff --git a/src/serde/Wrappers.Dictionary.cs b/src/serde/Wrappers.Dictionary.cs index 2575c462..be989a94 100644 --- a/src/serde/Wrappers.Dictionary.cs +++ b/src/serde/Wrappers.Dictionary.cs @@ -4,6 +4,11 @@ namespace Serde { + internal static class DictSerdeTypeInfo + { + public static readonly TypeInfo TypeInfo = TypeInfo.Create(TypeInfo.TypeKind.Dictionary, []); + } + public static class DictWrap { public readonly struct SerializeImpl @@ -22,7 +27,7 @@ public SerializeImpl(Dictionary dict) _dict = dict; } - void ISerialize.Serialize(ISerializer serializer) + public void Serialize(ISerializer serializer) { var sd = serializer.SerializeDictionary(_dict.Count); foreach (var (k, v) in _dict) @@ -33,7 +38,7 @@ void ISerialize.Serialize(ISerializer serializer) sd.End(); } - void ISerialize>.Serialize(Dictionary value, ISerializer serializer) + public void Serialize(Dictionary value, ISerializer serializer) { var sd = serializer.SerializeDictionary(value.Count); foreach (var (k, v) in value) @@ -50,37 +55,33 @@ void ISerialize.Serialize(ISerializer serializer) where TKeyWrap : IDeserialize where TValueWrap : IDeserialize { - static Dictionary IDeserialize>.Deserialize(IDeserializer deserializer) - { - return deserializer.DeserializeDictionary(Visitor.Instance); - } - private sealed class Visitor : IDeserializeVisitor> + public static Dictionary Deserialize(IDeserializer deserializer) { - public static readonly Visitor Instance = new Visitor(); - public string ExpectedTypeName => "Dictionary<" + typeof(TKey).Name + ", " + typeof(TValue).Name + ">"; - public Dictionary VisitDictionary(ref D d) - where D : IDeserializeDictionary + var typeInfo = DictSerdeTypeInfo.TypeInfo; + var deCollection = deserializer.DeserializeCollection(typeInfo); + Dictionary dict; + if (deCollection.SizeOpt is int size) { - Dictionary dict; - if (d.SizeOpt is int size) - { - dict = new Dictionary(size); - } - else - { - size = -1; // Set initial size to unknown - dict = new Dictionary(); - } - while (d.TryGetNextEntry(out var next)) - { - dict.Add(next.Item1, next.Item2); - } - if (size >= 0 && size != dict.Count) + dict = new(size); + } + else + { + size = -1; // Set initial size to unknown + dict = new(); + } + while (deCollection.TryReadValue(typeInfo, out var key)) + { + if (!deCollection.TryReadValue(typeInfo, out var value)) { - throw new InvalidDeserializeValueException($"Expected {size} items, found {dict.Count}"); + throw new InvalidDeserializeValueException("Expected value, but reached end of collection."); } - return dict; + dict.Add(key, value); + } + if (size >= 0 && size != dict.Count) + { + throw new InvalidDeserializeValueException($"Expected {size} items, found {dict.Count}"); } + return dict; } } } @@ -97,7 +98,7 @@ public static class IDictWrap public static SerializeImpl Create(IDictionary t) => new SerializeImpl(t); - void ISerialize>.Serialize(IDictionary value, ISerializer serializer) + public void Serialize(IDictionary value, ISerializer serializer) { var sd = serializer.SerializeDictionary(value.Count); foreach (var (k, v) in value) @@ -107,7 +108,7 @@ public static class IDictWrap } sd.End(); } - void ISerialize.Serialize(ISerializer serializer) + public void Serialize(ISerializer serializer) { var sd = serializer.SerializeDictionary(Value.Count); foreach (var (k, v) in Value) @@ -132,7 +133,7 @@ public static class IRODictWrap public static SerializeImpl Create(IReadOnlyDictionary t) => new SerializeImpl(t); - void ISerialize.Serialize(ISerializer serializer) + public void Serialize(ISerializer serializer) { var sd = serializer.SerializeDictionary(Value.Count); foreach (var (k, v) in Value) diff --git a/src/serde/Wrappers.List.cs b/src/serde/Wrappers.List.cs index a896deb8..89abcec6 100644 --- a/src/serde/Wrappers.List.cs +++ b/src/serde/Wrappers.List.cs @@ -57,6 +57,11 @@ public static class EnumerableHelpers } } + internal static class EnumerableSerdeTypeInfo + { + public static readonly TypeInfo TypeInfo = TypeInfo.Create(TypeInfo.TypeKind.Enumerable, []); + } + public static class ArrayWrap { public readonly record struct SerializeImpl(T[] Value) @@ -65,48 +70,41 @@ public static class ArrayWrap { public static SerializeImpl Create(T[] t) => new SerializeImpl(t); - void ISerialize.Serialize(T[] value, ISerializer serializer) + public void Serialize(T[] value, ISerializer serializer) => EnumerableHelpers.SerializeSpan(typeof(T[]).ToString(), value, serializer); - void ISerialize.Serialize(ISerializer serializer) + public void Serialize(ISerializer serializer) => EnumerableHelpers.SerializeSpan(typeof(T[]).ToString(), Value, serializer); } public readonly struct DeserializeImpl : IDeserialize where TWrap : IDeserialize { - static T[] IDeserialize.Deserialize(IDeserializer deserializer) + public static T[] Deserialize(IDeserializer deserializer) { - return deserializer.DeserializeEnumerable(new SerdeVisitor()); - } - private sealed class SerdeVisitor : IDeserializeVisitor - { - string IDeserializeVisitor.ExpectedTypeName => typeof(T[]).ToString(); - - T[] IDeserializeVisitor.VisitEnumerable(ref D d) + var typeInfo = EnumerableSerdeTypeInfo.TypeInfo; + var deCollection = deserializer.DeserializeCollection(typeInfo); + if (deCollection.SizeOpt is int size) { - if (d.SizeOpt is int size) + var array = new T[size]; + for (int i = 0; i < size; i++) { - var array = new T[size]; - for (int i = 0; i < size; i++) + if (!deCollection.TryReadValue(typeInfo, out var value)) { - if (!d.TryGetNext(out T? next)) - { - throw new InvalidDeserializeValueException($"Expected enumerable of size {size}, but only received {i} items"); - } - array[i] = next; + throw new InvalidDeserializeValueException($"Expected array of size {size}, but only received {i} items"); } - return array; + array[i] = value; } - else + return array; + } + else + { + var list = new List(); + while (deCollection.TryReadValue(typeInfo, out var value)) { - var list = new List(); - while (d.TryGetNext(out T? next)) - { - list.Add(next); - } - return list.ToArray(); + list.Add(value); } + return list.ToArray(); } } } @@ -120,46 +118,39 @@ public static class ListWrap { public static SerializeImpl Create(List t) => new SerializeImpl(t); - void ISerialize.Serialize(ISerializer serializer) + public void Serialize(ISerializer serializer) => EnumerableHelpers.SerializeList(typeof(List).ToString(), Value, serializer); - void ISerialize>.Serialize(List value, ISerializer serializer) + public void Serialize(List value, ISerializer serializer) => EnumerableHelpers.SerializeList(typeof(List).ToString(), value, serializer); } public readonly struct DeserializeImpl : IDeserialize> where TWrap : IDeserialize { - static List IDeserialize>.Deserialize(IDeserializer deserializer) - { - return deserializer.DeserializeEnumerable(new SerdeVisitor()); - } - private sealed class SerdeVisitor : IDeserializeVisitor> + public static List Deserialize(IDeserializer deserializer) { - string IDeserializeVisitor>.ExpectedTypeName => typeof(T[]).ToString(); - - List IDeserializeVisitor>.VisitEnumerable(ref D d) + List list; + var typeInfo = EnumerableSerdeTypeInfo.TypeInfo; + var deCollection = deserializer.DeserializeCollection(typeInfo); + if (deCollection.SizeOpt is int size) { - List list; - if (d.SizeOpt is int size) - { - list = new List(size); - } - else - { - size = -1; // Set initial size to unknown - list = new List(); - } - while (d.TryGetNext(out T? next)) - { - list.Add(next); - } - if (size >= 0 && list.Count != size) - { - throw new InvalidDeserializeValueException($"Expected enumerable of size {size}, but only received {list.Count} items"); - } - return list; + list = new List(size); + } + else + { + size = -1; // Set initial size to unknown + list = new List(); + } + while (deCollection.TryReadValue(typeInfo, out T? next)) + { + list.Add(next); } + if (size >= 0 && list.Count != size) + { + throw new InvalidDeserializeValueException($"Expected enumerable of size {size}, but only received {list.Count} items"); + } + return list; } } } @@ -172,47 +163,40 @@ public static class ImmutableArrayWrap { public static SerializeImpl Create(ImmutableArray t) => new SerializeImpl(t); - void ISerialize.Serialize(ISerializer serializer) + public void Serialize(ISerializer serializer) => EnumerableHelpers.SerializeSpan(typeof(ImmutableArray).ToString(), Value.AsSpan(), serializer); - void ISerialize>.Serialize(ImmutableArray value, ISerializer serializer) + public void Serialize(ImmutableArray value, ISerializer serializer) => EnumerableHelpers.SerializeSpan(typeof(ImmutableArray).ToString(), value.AsSpan(), serializer); } public readonly struct DeserializeImpl : IDeserialize> where TWrap : IDeserialize { - static ImmutableArray IDeserialize>.Deserialize(IDeserializer deserializer) + public static ImmutableArray Deserialize(IDeserializer deserializer) { - return deserializer.DeserializeEnumerable(new Visitor()); - } - - private struct Visitor : IDeserializeVisitor> - { - public string ExpectedTypeName => typeof(ImmutableArray).ToString(); - ImmutableArray IDeserializeVisitor>.VisitEnumerable(ref D d) + ImmutableArray.Builder builder; + var typeInfo = EnumerableSerdeTypeInfo.TypeInfo; + var d = deserializer.DeserializeCollection(typeInfo); + if (d.SizeOpt is int size) { - ImmutableArray.Builder builder; - if (d.SizeOpt is int size) - { - builder = ImmutableArray.CreateBuilder(size); - } - else - { - size = -1; // Set initial size to unknown - builder = ImmutableArray.CreateBuilder(); - } + builder = ImmutableArray.CreateBuilder(size); + } + else + { + size = -1; // Set initial size to unknown + builder = ImmutableArray.CreateBuilder(); + } - while (d.TryGetNext(out T? next)) - { - builder.Add(next); - } - if (size >= 0 && builder.Count != size) - { - throw new InvalidDeserializeValueException($"Expected {size} items, found {builder.Count}"); - } - return builder.ToImmutable(); + while (d.TryReadValue(typeInfo, out T? next)) + { + builder.Add(next); + } + if (size >= 0 && builder.Count != size) + { + throw new InvalidDeserializeValueException($"Expected {size} items, found {builder.Count}"); } + return builder.ToImmutable(); } } } diff --git a/src/serde/json/JsonDeserializer.cs b/src/serde/json/JsonDeserializer.cs index 01a730bc..e64000fa 100644 --- a/src/serde/json/JsonDeserializer.cs +++ b/src/serde/json/JsonDeserializer.cs @@ -87,6 +87,64 @@ public T DeserializeDictionary(IDeserializeVisitor v) return v.VisitDictionary(ref map); } + public IDeserializeCollection DeserializeCollection(TypeInfo typeInfo) + { + if (typeInfo.Kind is not (TypeInfo.TypeKind.Enumerable or TypeInfo.TypeKind.Dictionary)) + { + throw new ArgumentException($"TypeKind is {typeInfo.Kind}, expected Enumerable or Dictionary"); + } + + ref var reader = ref GetReader(); + reader.ReadOrThrow(); + + if (typeInfo.Kind == TypeInfo.TypeKind.Dictionary && reader.TokenType != JsonTokenType.StartObject + || typeInfo.Kind == TypeInfo.TypeKind.Enumerable && reader.TokenType != JsonTokenType.StartArray) + { + throw new InvalidDeserializeValueException("Expected object start"); + } + + return new DeCollection(this); + } + + private struct DeCollection : IDeserializeCollection + { + private JsonDeserializer _deserializer; + public DeCollection(JsonDeserializer de) + { + _deserializer = de; + } + + public int? SizeOpt => null; + + public bool TryReadValue(TypeInfo typeInfo, [MaybeNullWhen(false)] out T next) where D : IDeserialize + { + var reader = _deserializer.GetReader(); + reader.ReadOrThrow(); + switch (reader.TokenType) + { + case JsonTokenType.EndArray: + if (typeInfo.Kind != TypeInfo.TypeKind.Enumerable) + { + throw new InvalidDeserializeValueException($"Unexpected end of array in type kind: {typeInfo.Kind}"); + } + break; + case JsonTokenType.EndObject: + if (typeInfo.Kind != TypeInfo.TypeKind.Dictionary) + { + throw new InvalidDeserializeValueException($"Unexpected end of object in type kind: {typeInfo.Kind}"); + } + break; + default: + next = D.Deserialize(_deserializer); + return true; + } + _deserializer.SaveState(reader); + next = default; + _deserializer = null!; + return false; + } + } + public T DeserializeFloat(IDeserializeVisitor v) => DeserializeDouble(v); @@ -288,6 +346,7 @@ public T DeserializeNullableRef(IDeserializeVisitor v) reader.ReadOrThrow(); if (reader.TokenType == JsonTokenType.Null) { + SaveState(reader); return v.VisitNull(); } else diff --git a/test/Serde.Generation.Test/DeserializeTests.cs b/test/Serde.Generation.Test/DeserializeTests.cs index e2b97e74..5518d327 100644 --- a/test/Serde.Generation.Test/DeserializeTests.cs +++ b/test/Serde.Generation.Test/DeserializeTests.cs @@ -98,6 +98,7 @@ partial struct Rgb """; return VerifyDeserialize(src); } + [Fact] public Task Rgb() { diff --git a/test/Serde.Generation.Test/test_output/AllInOneTest.GeneratorTest/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/AllInOneTest.GeneratorTest/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.verified.cs index 085943e9..13b16d8e 100644 --- a/test/Serde.Generation.Test/test_output/AllInOneTest.GeneratorTest/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/AllInOneTest.GeneratorTest/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.verified.cs @@ -4,7 +4,9 @@ partial record AllInOne { internal static class ColorEnumSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Red")!), ("blue", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Blue")!), ("green", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Green")!) diff --git a/test/Serde.Generation.Test/test_output/AllInOneTest.GeneratorTest/Serde.Test.AllInOneSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/AllInOneTest.GeneratorTest/Serde.Test.AllInOneSerdeTypeInfo.verified.cs index f5916a4f..59500b9e 100644 --- a/test/Serde.Generation.Test/test_output/AllInOneTest.GeneratorTest/Serde.Test.AllInOneSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/AllInOneTest.GeneratorTest/Serde.Test.AllInOneSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Serde.Test; internal static class AllInOneSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("boolField", typeof(Serde.Test.AllInOne).GetField("BoolField")!), ("charField", typeof(Serde.Test.AllInOne).GetField("CharField")!), ("byteField", typeof(Serde.Test.AllInOne).GetField("ByteField")!), diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/CSerdeTypeInfo.verified.cs index b13ad01c..7da26460 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("colorInt", typeof(C).GetField("ColorInt")!), ("colorByte", typeof(C).GetField("ColorByte")!), ("colorLong", typeof(C).GetField("ColorLong")!), diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorByteSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorByteSerdeTypeInfo.verified.cs index 31ebb755..0035cc43 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorByteSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorByteSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: ColorByteSerdeTypeInfo.cs internal static class ColorByteSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(ColorByte).GetField("Red")!), ("green", typeof(ColorByte).GetField("Green")!), ("blue", typeof(ColorByte).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorIntSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorIntSerdeTypeInfo.verified.cs index 5ef2fcae..43f6ded2 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorIntSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorIntSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: ColorIntSerdeTypeInfo.cs internal static class ColorIntSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(ColorInt).GetField("Red")!), ("green", typeof(ColorInt).GetField("Green")!), ("blue", typeof(ColorInt).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorLongSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorLongSerdeTypeInfo.verified.cs index f1283838..7052f6ee 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorLongSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorLongSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: ColorLongSerdeTypeInfo.cs internal static class ColorLongSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(ColorLong).GetField("Red")!), ("green", typeof(ColorLong).GetField("Green")!), ("blue", typeof(ColorLong).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorULongSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorULongSerdeTypeInfo.verified.cs index 2ce137c3..08b334c6 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorULongSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests.EnumMember/ColorULongSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: ColorULongSerdeTypeInfo.cs internal static class ColorULongSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(ColorULong).GetField("Red")!), ("green", typeof(ColorULong).GetField("Green")!), ("blue", typeof(ColorULong).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests.NestedExplicitDeserializeWrapper/BIND_OPTSSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests.NestedExplicitDeserializeWrapper/BIND_OPTSSerdeTypeInfo.verified.cs index f06b61b7..c0c2e58d 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests.NestedExplicitDeserializeWrapper/BIND_OPTSSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests.NestedExplicitDeserializeWrapper/BIND_OPTSSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: BIND_OPTSSerdeTypeInfo.cs internal static class BIND_OPTSSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("cbStruct", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("cbStruct")!), ("dwTickCountDeadline", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("dwTickCountDeadline")!), ("grfFlags", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("grfFlags")!), diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests.NestedExplicitDeserializeWrapper/SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests.NestedExplicitDeserializeWrapper/SSerdeTypeInfo.verified.cs index 2b5fea57..46160919 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests.NestedExplicitDeserializeWrapper/SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests.NestedExplicitDeserializeWrapper/SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("opts", typeof(S).GetField("Opts")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/Array#ArrayFieldSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/Array#ArrayFieldSerdeTypeInfo.verified.cs index 47128a40..6178cb4b 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/Array#ArrayFieldSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/Array#ArrayFieldSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: ArrayFieldSerdeTypeInfo.cs internal static class ArrayFieldSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("intArr", typeof(ArrayField).GetField("IntArr")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/DeserializeMissing#SetToNullSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/DeserializeMissing#SetToNullSerdeTypeInfo.verified.cs index eada32ef..6cc15675 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/DeserializeMissing#SetToNullSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/DeserializeMissing#SetToNullSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SetToNullSerdeTypeInfo.cs internal static class SetToNullSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("present", typeof(SetToNull).GetProperty("Present")!), ("missing", typeof(SetToNull).GetProperty("Missing")!), ("throwMissing", typeof(SetToNull).GetProperty("ThrowMissing")!) diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/DeserializeOnlyWrap#BIND_OPTSSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/DeserializeOnlyWrap#BIND_OPTSSerdeTypeInfo.verified.cs index f06b61b7..c0c2e58d 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/DeserializeOnlyWrap#BIND_OPTSSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/DeserializeOnlyWrap#BIND_OPTSSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: BIND_OPTSSerdeTypeInfo.cs internal static class BIND_OPTSSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("cbStruct", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("cbStruct")!), ("dwTickCountDeadline", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("dwTickCountDeadline")!), ("grfFlags", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("grfFlags")!), diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkip#RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkip#RgbSerdeTypeInfo.verified.cs index b37f2e10..498d85bc 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkip#RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkip#RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("blue", typeof(Rgb).GetField("Blue")!) }); diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkipDeserialize#RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkipDeserialize#RgbSerdeTypeInfo.verified.cs index 1814f10b..8682df6b 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkipDeserialize#RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkipDeserialize#RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("green", typeof(Rgb).GetField("Green")!), ("blue", typeof(Rgb).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkipSerialize#RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkipSerialize#RgbSerdeTypeInfo.verified.cs index 1814f10b..8682df6b 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkipSerialize#RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/MemberSkipSerialize#RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("green", typeof(Rgb).GetField("Green")!), ("blue", typeof(Rgb).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/NestedPartialClasses#A.B.C.DSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/NestedPartialClasses#A.B.C.DSerdeTypeInfo.verified.cs index 3032a166..c38c03f3 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/NestedPartialClasses#A.B.C.DSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/NestedPartialClasses#A.B.C.DSerdeTypeInfo.verified.cs @@ -7,7 +7,9 @@ partial class C { internal static class DSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("field", typeof(A.B.C.D).GetField("Field")!) }); } diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/NullableRefField#SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/NullableRefField#SSerdeTypeInfo.verified.cs index b98d8e44..a36f3051 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/NullableRefField#SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/NullableRefField#SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("f", typeof(S).GetField("F")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/DeserializeTests/Rgb#RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/DeserializeTests/Rgb#RgbSerdeTypeInfo.verified.cs index 1814f10b..8682df6b 100644 --- a/test/Serde.Generation.Test/test_output/DeserializeTests/Rgb#RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/DeserializeTests/Rgb#RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("green", typeof(Rgb).GetField("Green")!), ("blue", typeof(Rgb).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/MemberFormatTests.CamelCase/SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/MemberFormatTests.CamelCase/SSerdeTypeInfo.verified.cs index 7482c963..b0c570d6 100644 --- a/test/Serde.Generation.Test/test_output/MemberFormatTests.CamelCase/SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/MemberFormatTests.CamelCase/SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("one", typeof(S).GetProperty("One")!), ("twoWord", typeof(S).GetProperty("TwoWord")!) }); diff --git a/test/Serde.Generation.Test/test_output/MemberFormatTests.Default/SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/MemberFormatTests.Default/SSerdeTypeInfo.verified.cs index 7482c963..b0c570d6 100644 --- a/test/Serde.Generation.Test/test_output/MemberFormatTests.Default/SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/MemberFormatTests.Default/SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("one", typeof(S).GetProperty("One")!), ("twoWord", typeof(S).GetProperty("TwoWord")!) }); diff --git a/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumFormat/ColorEnumSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumFormat/ColorEnumSerdeTypeInfo.verified.cs index 22830c99..dc98cb94 100644 --- a/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumFormat/ColorEnumSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumFormat/ColorEnumSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: ColorEnumSerdeTypeInfo.cs internal static class ColorEnumSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("Red", typeof(ColorEnum).GetField("Red")!), ("Green", typeof(ColorEnum).GetField("Green")!), ("Blue", typeof(ColorEnum).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/ColorEnumSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/ColorEnumSerdeTypeInfo.verified.cs index c5d603e4..94a1894f 100644 --- a/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/ColorEnumSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/ColorEnumSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: ColorEnumSerdeTypeInfo.cs internal static class ColorEnumSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(ColorEnum).GetField("Red")!), ("green", typeof(ColorEnum).GetField("Green")!), ("blue", typeof(ColorEnum).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/S2SerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/S2SerdeTypeInfo.verified.cs index ff74b192..2cf54fac 100644 --- a/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/S2SerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/S2SerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: S2SerdeTypeInfo.cs internal static class S2SerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("E", typeof(S2).GetField("E")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/SSerdeTypeInfo.verified.cs index dc820e28..6d2f899f 100644 --- a/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/MemberFormatTests.EnumValues/SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("e", typeof(S).GetField("E")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/MemberFormatTests.KebabCase/SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/MemberFormatTests.KebabCase/SSerdeTypeInfo.verified.cs index 629b3808..2dc26439 100644 --- a/test/Serde.Generation.Test/test_output/MemberFormatTests.KebabCase/SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/MemberFormatTests.KebabCase/SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("one", typeof(S).GetProperty("One")!), ("two-word", typeof(S).GetProperty("TwoWord")!) }); diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.ArrayOfGenerateSerialize/TestCase15.Class0SerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.ArrayOfGenerateSerialize/TestCase15.Class0SerdeTypeInfo.verified.cs index b7015871..8704a746 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.ArrayOfGenerateSerialize/TestCase15.Class0SerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.ArrayOfGenerateSerialize/TestCase15.Class0SerdeTypeInfo.verified.cs @@ -3,7 +3,9 @@ partial class TestCase15 { internal static class Class0SerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("field0", typeof(TestCase15.Class0).GetField("Field0")!), ("field1", typeof(TestCase15.Class0).GetField("Field1")!) }); diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.ArrayOfGenerateSerialize/TestCase15.Class1SerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.ArrayOfGenerateSerialize/TestCase15.Class1SerdeTypeInfo.verified.cs index 7d3fc971..68e04a12 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.ArrayOfGenerateSerialize/TestCase15.Class1SerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.ArrayOfGenerateSerialize/TestCase15.Class1SerdeTypeInfo.verified.cs @@ -3,7 +3,9 @@ partial class TestCase15 { internal static class Class1SerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("field0", typeof(TestCase15.Class1).GetField("Field0")!), ("field1", typeof(TestCase15.Class1).GetField("Field1")!) }); diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.DictionaryGenerate2/C2SerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.DictionaryGenerate2/C2SerdeTypeInfo.verified.cs index 6e34da59..3111b89b 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.DictionaryGenerate2/C2SerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.DictionaryGenerate2/C2SerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: C2SerdeTypeInfo.cs internal static class C2SerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("map", typeof(C2).GetField("Map")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.DictionaryGenerate2/CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.DictionaryGenerate2/CSerdeTypeInfo.verified.cs index 401454bb..42cb6d25 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.DictionaryGenerate2/CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.DictionaryGenerate2/CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("x", typeof(C).GetProperty("X")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.CSerdeTypeInfo.verified.cs index a1b5d6f9..1fac730f 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.CSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Some.Nested.Namespace; internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("colorInt", typeof(Some.Nested.Namespace.C).GetField("ColorInt")!), ("colorByte", typeof(Some.Nested.Namespace.C).GetField("ColorByte")!), ("colorLong", typeof(Some.Nested.Namespace.C).GetField("ColorLong")!), diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorByteSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorByteSerdeTypeInfo.verified.cs index 04649101..c6ae474a 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorByteSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorByteSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Some.Nested.Namespace; internal static class ColorByteSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Some.Nested.Namespace.ColorByte).GetField("Red")!), ("green", typeof(Some.Nested.Namespace.ColorByte).GetField("Green")!), ("blue", typeof(Some.Nested.Namespace.ColorByte).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorIntSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorIntSerdeTypeInfo.verified.cs index 3d6b1f3b..7258ed4b 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorIntSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorIntSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Some.Nested.Namespace; internal static class ColorIntSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Some.Nested.Namespace.ColorInt).GetField("Red")!), ("green", typeof(Some.Nested.Namespace.ColorInt).GetField("Green")!), ("blue", typeof(Some.Nested.Namespace.ColorInt).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorLongSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorLongSerdeTypeInfo.verified.cs index a3a4dd48..26853939 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorLongSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorLongSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Some.Nested.Namespace; internal static class ColorLongSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Some.Nested.Namespace.ColorLong).GetField("Red")!), ("green", typeof(Some.Nested.Namespace.ColorLong).GetField("Green")!), ("blue", typeof(Some.Nested.Namespace.ColorLong).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorULongSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorULongSerdeTypeInfo.verified.cs index 7113d50e..9c50d33d 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorULongSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.EnumMember/Some.Nested.Namespace.ColorULongSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Some.Nested.Namespace; internal static class ColorULongSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Some.Nested.Namespace.ColorULong).GetField("Red")!), ("green", typeof(Some.Nested.Namespace.ColorULong).GetField("Green")!), ("blue", typeof(Some.Nested.Namespace.ColorULong).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.NestedEnumWrapper/CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.NestedEnumWrapper/CSerdeTypeInfo.verified.cs index 3104b69c..a2476d7b 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.NestedEnumWrapper/CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.NestedEnumWrapper/CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("colorOpt", typeof(C).GetField("ColorOpt")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.NestedEnumWrapper/RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.NestedEnumWrapper/RgbSerdeTypeInfo.verified.cs index 1814f10b..8682df6b 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.NestedEnumWrapper/RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.NestedEnumWrapper/RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("green", typeof(Rgb).GetField("Green")!), ("blue", typeof(Rgb).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.NestedExplicitSerializeWrapper/BIND_OPTSSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.NestedExplicitSerializeWrapper/BIND_OPTSSerdeTypeInfo.verified.cs index f06b61b7..c0c2e58d 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.NestedExplicitSerializeWrapper/BIND_OPTSSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.NestedExplicitSerializeWrapper/BIND_OPTSSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: BIND_OPTSSerdeTypeInfo.cs internal static class BIND_OPTSSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("cbStruct", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("cbStruct")!), ("dwTickCountDeadline", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("dwTickCountDeadline")!), ("grfFlags", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("grfFlags")!), diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.NestedExplicitSerializeWrapper/SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.NestedExplicitSerializeWrapper/SSerdeTypeInfo.verified.cs index 2b5fea57..46160919 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.NestedExplicitSerializeWrapper/SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.NestedExplicitSerializeWrapper/SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("opts", typeof(S).GetField("Opts")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests.SerializeOnlyWrapper/SectionSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests.SerializeOnlyWrapper/SectionSerdeTypeInfo.verified.cs index 465d11c5..a400ed14 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests.SerializeOnlyWrapper/SectionSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests.SerializeOnlyWrapper/SectionSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SectionSerdeTypeInfo.cs internal static class SectionSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("mask", typeof(System.Collections.Specialized.BitVector32.Section).GetProperty("Mask")!), ("offset", typeof(System.Collections.Specialized.BitVector32.Section).GetProperty("Offset")!) }); diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/DictionaryGenerate#CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/DictionaryGenerate#CSerdeTypeInfo.verified.cs index 532e553e..a4b29857 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/DictionaryGenerate#CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/DictionaryGenerate#CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("map", typeof(C).GetField("Map")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/ExplicitGenericWrapper#CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/ExplicitGenericWrapper#CSerdeTypeInfo.verified.cs index 46ef2d53..e7c85904 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/ExplicitGenericWrapper#CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/ExplicitGenericWrapper#CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("s", typeof(C).GetField("S")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/ExplicitWrapper#CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/ExplicitWrapper#CSerdeTypeInfo.verified.cs index 46ef2d53..e7c85904 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/ExplicitWrapper#CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/ExplicitWrapper#CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("s", typeof(C).GetField("S")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/IDictionaryImplGenerate#CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/IDictionaryImplGenerate#CSerdeTypeInfo.verified.cs index a9aa12d8..9ca91310 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/IDictionaryImplGenerate#CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/IDictionaryImplGenerate#CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("rDictionary", typeof(C).GetField("RDictionary")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkip#RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkip#RgbSerdeTypeInfo.verified.cs index b37f2e10..498d85bc 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkip#RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkip#RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("blue", typeof(Rgb).GetField("Blue")!) }); diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkipDeserialize#RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkipDeserialize#RgbSerdeTypeInfo.verified.cs index 1814f10b..8682df6b 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkipDeserialize#RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkipDeserialize#RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("green", typeof(Rgb).GetField("Green")!), ("blue", typeof(Rgb).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkipSerialize#RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkipSerialize#RgbSerdeTypeInfo.verified.cs index 1814f10b..8682df6b 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkipSerialize#RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/MemberSkipSerialize#RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("green", typeof(Rgb).GetField("Green")!), ("blue", typeof(Rgb).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/NestedArray#CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/NestedArray#CSerdeTypeInfo.verified.cs index 4f9ee198..38463bfa 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/NestedArray#CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/NestedArray#CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("nestedArr", typeof(C).GetField("NestedArr")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/NestedArray2#CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/NestedArray2#CSerdeTypeInfo.verified.cs index 4f9ee198..38463bfa 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/NestedArray2#CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/NestedArray2#CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("nestedArr", typeof(C).GetField("NestedArr")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/NestedPartialClasses#A.B.C.DSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/NestedPartialClasses#A.B.C.DSerdeTypeInfo.verified.cs index 3032a166..c38c03f3 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/NestedPartialClasses#A.B.C.DSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/NestedPartialClasses#A.B.C.DSerdeTypeInfo.verified.cs @@ -7,7 +7,9 @@ partial class C { internal static class DSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("field", typeof(A.B.C.D).GetField("Field")!) }); } diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/NullableFields#SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/NullableFields#SSerdeTypeInfo.verified.cs index 27563966..4f18b4fe 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/NullableFields#SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/NullableFields#SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("fI", typeof(S<,,>).GetField("FI")!), ("f1", typeof(S<,,>).GetField("F1")!), ("f2", typeof(S<,,>).GetField("F2")!), diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/NullableRefFields#SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/NullableRefFields#SSerdeTypeInfo.verified.cs index f7dabd73..91739372 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/NullableRefFields#SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/NullableRefFields#SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("fS", typeof(S<,,,,>).GetField("FS")!), ("f1", typeof(S<,,,,>).GetField("F1")!), ("f2", typeof(S<,,,,>).GetField("F2")!), diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/Rgb#RgbSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/Rgb#RgbSerdeTypeInfo.verified.cs index 1814f10b..8682df6b 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/Rgb#RgbSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/Rgb#RgbSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RgbSerdeTypeInfo.cs internal static class RgbSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Rgb).GetField("Red")!), ("green", typeof(Rgb).GetField("Green")!), ("blue", typeof(Rgb).GetField("Blue")!) diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/TypeDoesntImplementISerialize#S1SerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/TypeDoesntImplementISerialize#S1SerdeTypeInfo.verified.cs index 3d899508..91b43023 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/TypeDoesntImplementISerialize#S1SerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/TypeDoesntImplementISerialize#S1SerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: S1SerdeTypeInfo.cs internal static class S1SerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("x", typeof(S1).GetField("X")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/TypeWithArray#CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/TypeWithArray#CSerdeTypeInfo.verified.cs index bc1d2434..2c75db7f 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/TypeWithArray#CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/TypeWithArray#CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("intArr", typeof(C).GetField("IntArr")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/SerializeTests/WrongGenericWrapperForm#CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/SerializeTests/WrongGenericWrapperForm#CSerdeTypeInfo.verified.cs index 46ef2d53..e7c85904 100644 --- a/test/Serde.Generation.Test/test_output/SerializeTests/WrongGenericWrapperForm#CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/SerializeTests/WrongGenericWrapperForm#CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("s", typeof(C).GetField("S")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.AttributeWrapperTest/AddressSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.AttributeWrapperTest/AddressSerdeTypeInfo.verified.cs index 2edc823b..cada6f70 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.AttributeWrapperTest/AddressSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.AttributeWrapperTest/AddressSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: AddressSerdeTypeInfo.cs internal static class AddressSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("name", typeof(Address).GetField("Name")!), ("line1", typeof(Address).GetField("Line1")!), ("city", typeof(Address).GetField("City")!), diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.GenerateSerdeWrap/BIND_OPTSSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.GenerateSerdeWrap/BIND_OPTSSerdeTypeInfo.verified.cs index f06b61b7..c0c2e58d 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.GenerateSerdeWrap/BIND_OPTSSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.GenerateSerdeWrap/BIND_OPTSSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: BIND_OPTSSerdeTypeInfo.cs internal static class BIND_OPTSSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("cbStruct", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("cbStruct")!), ("dwTickCountDeadline", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("dwTickCountDeadline")!), ("grfFlags", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("grfFlags")!), diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.ImmutableArrayEnumDeserialize/Test.ChannelListSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.ImmutableArrayEnumDeserialize/Test.ChannelListSerdeTypeInfo.verified.cs index c8427c4f..d69b25ea 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.ImmutableArrayEnumDeserialize/Test.ChannelListSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.ImmutableArrayEnumDeserialize/Test.ChannelListSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Test; internal static class ChannelListSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("channels", typeof(Test.ChannelList).GetProperty("Channels")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.ImmutableArrayEnumDeserialize/Test.ChannelSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.ImmutableArrayEnumDeserialize/Test.ChannelSerdeTypeInfo.verified.cs index ae5e76ca..36597339 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.ImmutableArrayEnumDeserialize/Test.ChannelSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.ImmutableArrayEnumDeserialize/Test.ChannelSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Test; internal static class ChannelSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("a", typeof(Test.Channel).GetField("A")!), ("b", typeof(Test.Channel).GetField("B")!), ("c", typeof(Test.Channel).GetField("C")!) diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.NestedDeserializeWrap/BIND_OPTSSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.NestedDeserializeWrap/BIND_OPTSSerdeTypeInfo.verified.cs index f06b61b7..c0c2e58d 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.NestedDeserializeWrap/BIND_OPTSSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.NestedDeserializeWrap/BIND_OPTSSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: BIND_OPTSSerdeTypeInfo.cs internal static class BIND_OPTSSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("cbStruct", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("cbStruct")!), ("dwTickCountDeadline", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("dwTickCountDeadline")!), ("grfFlags", typeof(System.Runtime.InteropServices.ComTypes.BIND_OPTS).GetField("grfFlags")!), diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.NestedDeserializeWrap/CSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.NestedDeserializeWrap/CSerdeTypeInfo.verified.cs index 46ef2d53..e7c85904 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.NestedDeserializeWrap/CSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.NestedDeserializeWrap/CSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: CSerdeTypeInfo.cs internal static class CSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("s", typeof(C).GetField("S")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.NestedExplicitWrapper/Outer.SectionSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.NestedExplicitWrapper/Outer.SectionSerdeTypeInfo.verified.cs index 98c4428a..3c89bb84 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.NestedExplicitWrapper/Outer.SectionSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.NestedExplicitWrapper/Outer.SectionSerdeTypeInfo.verified.cs @@ -3,7 +3,9 @@ partial class Outer { internal static class SectionSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("mask", typeof(System.Collections.Specialized.BitVector32.Section).GetProperty("Mask")!), ("offset", typeof(System.Collections.Specialized.BitVector32.Section).GetProperty("Offset")!) }); diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.NestedExplicitWrapper/SSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.NestedExplicitWrapper/SSerdeTypeInfo.verified.cs index 50a9cf4f..b6b7e227 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.NestedExplicitWrapper/SSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.NestedExplicitWrapper/SSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: SSerdeTypeInfo.cs internal static class SSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("sections", typeof(S).GetField("Sections")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.PointWrap/PointSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.PointWrap/PointSerdeTypeInfo.verified.cs index 23d1660a..231b00a3 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.PointWrap/PointSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.PointWrap/PointSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: PointSerdeTypeInfo.cs internal static class PointSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("x", typeof(Point).GetField("X")!), ("y", typeof(Point).GetField("Y")!) }); diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.PositionalRecordDeserialize/RSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.PositionalRecordDeserialize/RSerdeTypeInfo.verified.cs index 78751a3d..7e9a1322 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.PositionalRecordDeserialize/RSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.PositionalRecordDeserialize/RSerdeTypeInfo.verified.cs @@ -1,7 +1,9 @@ //HintName: RSerdeTypeInfo.cs internal static class RSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("a", typeof(R).GetProperty("A")!), ("b", typeof(R).GetProperty("B")!) }); diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.RecursiveType/Test.ParentSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.RecursiveType/Test.ParentSerdeTypeInfo.verified.cs index baa8b9b5..11bfe20c 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.RecursiveType/Test.ParentSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.RecursiveType/Test.ParentSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Test; internal static class ParentSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("r", typeof(Test.Parent).GetProperty("R")!) }); } \ No newline at end of file diff --git a/test/Serde.Generation.Test/test_output/WrapperTests.RecursiveType/Test.RecursiveSerdeTypeInfo.verified.cs b/test/Serde.Generation.Test/test_output/WrapperTests.RecursiveType/Test.RecursiveSerdeTypeInfo.verified.cs index face0385..26ea52d1 100644 --- a/test/Serde.Generation.Test/test_output/WrapperTests.RecursiveType/Test.RecursiveSerdeTypeInfo.verified.cs +++ b/test/Serde.Generation.Test/test_output/WrapperTests.RecursiveType/Test.RecursiveSerdeTypeInfo.verified.cs @@ -2,7 +2,9 @@ namespace Test; internal static class RecursiveSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("next", typeof(Recursive).GetProperty("Next")!) }); } \ No newline at end of file diff --git a/test/Serde.Test/CustomImplTests.cs b/test/Serde.Test/CustomImplTests.cs index fe933f46..a79efbea 100644 --- a/test/Serde.Test/CustomImplTests.cs +++ b/test/Serde.Test/CustomImplTests.cs @@ -12,7 +12,7 @@ private sealed partial record RgbWithFieldMap : IDeserialize { public int Red, Green, Blue; - private static readonly TypeInfo s_fieldMap = TypeInfo.Create([ + private static readonly TypeInfo s_fieldMap = TypeInfo.Create(TypeInfo.TypeKind.CustomType, [ ("red", typeof(RgbWithFieldMap).GetField("Red")!), ("green", typeof(RgbWithFieldMap).GetField("Green")!), ("blue", typeof(RgbWithFieldMap).GetField("Blue")!) diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.cs index 21e67b52..c022f92e 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial record AllInOne { internal static class ColorEnumSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Red")!), ("blue", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Blue")!), ("green", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Green")!) diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOneSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOneSerdeTypeInfo.cs index 79728a45..f3ab8a04 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOneSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOneSerdeTypeInfo.cs @@ -1,7 +1,9 @@ namespace Serde.Test; internal static class AllInOneSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("boolField", typeof(Serde.Test.AllInOne).GetField("BoolField")!), ("charField", typeof(Serde.Test.AllInOne).GetField("CharField")!), ("byteField", typeof(Serde.Test.AllInOne).GetField("ByteField")!), diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.CustomImplTests.RgbWithFieldMapSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.CustomImplTests.RgbWithFieldMapSerdeTypeInfo.cs index 75fc2e25..629b8ee6 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.CustomImplTests.RgbWithFieldMapSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.CustomImplTests.RgbWithFieldMapSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class CustomImplTests { internal static class RgbWithFieldMapSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Serde.Test.CustomImplTests.RgbWithFieldMap).GetField("Red")!), ("green", typeof(Serde.Test.CustomImplTests.RgbWithFieldMap).GetField("Green")!), ("blue", typeof(Serde.Test.CustomImplTests.RgbWithFieldMap).GetField("Blue")!) diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.GenericWrapperTests.CustomArrayWrapExplicitOnTypeSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.GenericWrapperTests.CustomArrayWrapExplicitOnTypeSerdeTypeInfo.cs index e3a1e354..ef5b1419 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.GenericWrapperTests.CustomArrayWrapExplicitOnTypeSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.GenericWrapperTests.CustomArrayWrapExplicitOnTypeSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class GenericWrapperTests { internal static class CustomArrayWrapExplicitOnTypeSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("a", typeof(Serde.Test.GenericWrapperTests.CustomArrayWrapExplicitOnType).GetField("A")!) }); } diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.GenericWrapperTests.CustomImArrayExplicitWrapOnMemberSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.GenericWrapperTests.CustomImArrayExplicitWrapOnMemberSerdeTypeInfo.cs index cb9a930b..cf19b503 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.GenericWrapperTests.CustomImArrayExplicitWrapOnMemberSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.GenericWrapperTests.CustomImArrayExplicitWrapOnMemberSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class GenericWrapperTests { internal static class CustomImArrayExplicitWrapOnMemberSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("a", typeof(Serde.Test.GenericWrapperTests.CustomImArrayExplicitWrapOnMember).GetField("A")!) }); } diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.DenyUnknownSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.DenyUnknownSerdeTypeInfo.cs index 0493ac0c..df75dba5 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.DenyUnknownSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.DenyUnknownSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonDeserializeTests { internal static class DenyUnknownSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("present", typeof(Serde.Test.JsonDeserializeTests.DenyUnknown).GetProperty("Present")!), ("missing", typeof(Serde.Test.JsonDeserializeTests.DenyUnknown).GetProperty("Missing")!) }); diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.ExtraMembersSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.ExtraMembersSerdeTypeInfo.cs index e0cf8502..23e49643 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.ExtraMembersSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.ExtraMembersSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonDeserializeTests { internal static class ExtraMembersSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("b", typeof(Serde.Test.JsonDeserializeTests.ExtraMembers).GetField("b")!) }); } diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.IdStructListSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.IdStructListSerdeTypeInfo.cs index 075fed87..c6cd8149 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.IdStructListSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.IdStructListSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonDeserializeTests { internal static class IdStructListSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("count", typeof(Serde.Test.JsonDeserializeTests.IdStructList).GetProperty("Count")!), ("list", typeof(Serde.Test.JsonDeserializeTests.IdStructList).GetProperty("List")!) }); diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.IdStructSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.IdStructSerdeTypeInfo.cs index 933237d0..895bb424 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.IdStructSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.IdStructSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonDeserializeTests { internal static class IdStructSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("id", typeof(Serde.Test.JsonDeserializeTests.IdStruct).GetField("Id")!) }); } diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.NullableFieldsSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.NullableFieldsSerdeTypeInfo.cs index f2f989ba..5a9220f4 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.NullableFieldsSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.NullableFieldsSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonDeserializeTests { internal static class NullableFieldsSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("s", typeof(Serde.Test.JsonDeserializeTests.NullableFields).GetField("S")!), ("dict", typeof(Serde.Test.JsonDeserializeTests.NullableFields).GetField("Dict")!) }); diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.SetToNullSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.SetToNullSerdeTypeInfo.cs index d90e60a8..07d8a8c7 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.SetToNullSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.SetToNullSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonDeserializeTests { internal static class SetToNullSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("present", typeof(Serde.Test.JsonDeserializeTests.SetToNull).GetProperty("Present")!), ("missing", typeof(Serde.Test.JsonDeserializeTests.SetToNull).GetProperty("Missing")!) }); diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.SkipDeserializeSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.SkipDeserializeSerdeTypeInfo.cs index b51edbb7..741db0d8 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.SkipDeserializeSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.SkipDeserializeSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonDeserializeTests { internal static class SkipDeserializeSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("required", typeof(Serde.Test.JsonDeserializeTests.SkipDeserialize).GetProperty("Required")!), ("skip", typeof(Serde.Test.JsonDeserializeTests.SkipDeserialize).GetProperty("Skip")!) }); diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.ThrowMissingSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.ThrowMissingSerdeTypeInfo.cs index 229fb742..a26ad56c 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.ThrowMissingSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonDeserializeTests.ThrowMissingSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonDeserializeTests { internal static class ThrowMissingSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("present", typeof(Serde.Test.JsonDeserializeTests.ThrowMissing).GetProperty("Present")!), ("missing", typeof(Serde.Test.JsonDeserializeTests.ThrowMissing).GetProperty("Missing")!) }); diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonSerializerTests.NullableFieldsSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonSerializerTests.NullableFieldsSerdeTypeInfo.cs index 66c2db91..61285a37 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonSerializerTests.NullableFieldsSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.JsonSerializerTests.NullableFieldsSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class JsonSerializerTests { internal static class NullableFieldsSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("s", typeof(Serde.Test.JsonSerializerTests.NullableFields).GetField("S")!), ("d", typeof(Serde.Test.JsonSerializerTests.NullableFields).GetField("D")!) }); diff --git a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.MaxSizeTypeSerdeTypeInfo.cs b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.MaxSizeTypeSerdeTypeInfo.cs index 8d36c86b..fff7ea8b 100644 --- a/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.MaxSizeTypeSerdeTypeInfo.cs +++ b/test/Serde.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.MaxSizeTypeSerdeTypeInfo.cs @@ -1,7 +1,9 @@ namespace Serde.Test; internal static class MaxSizeTypeSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("field1", typeof(Serde.Test.MaxSizeType).GetProperty("Field1")!), ("field2", typeof(Serde.Test.MaxSizeType).GetProperty("Field2")!), ("field3", typeof(Serde.Test.MaxSizeType).GetProperty("Field3")!), diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.cs index 21e67b52..c022f92e 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOne.ColorEnumSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial record AllInOne { internal static class ColorEnumSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("red", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Red")!), ("blue", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Blue")!), ("green", typeof(Serde.Test.AllInOne.ColorEnum).GetField("Green")!) diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOneSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOneSerdeTypeInfo.cs index 79728a45..f3ab8a04 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOneSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.AllInOneSerdeTypeInfo.cs @@ -1,7 +1,9 @@ namespace Serde.Test; internal static class AllInOneSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("boolField", typeof(Serde.Test.AllInOne).GetField("BoolField")!), ("charField", typeof(Serde.Test.AllInOne).GetField("CharField")!), ("byteField", typeof(Serde.Test.AllInOne).GetField("ByteField")!), diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.AddressSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.AddressSerdeTypeInfo.cs index 42b360f4..568ffafa 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.AddressSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.AddressSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class SampleTest { internal static class AddressSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("Name", typeof(Serde.Test.SampleTest.Address).GetField("Name")!), ("Line1", typeof(Serde.Test.SampleTest.Address).GetField("Line1")!), ("City", typeof(Serde.Test.SampleTest.Address).GetField("City")!), diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.OrderedItemSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.OrderedItemSerdeTypeInfo.cs index 8e22a74f..fc7aee14 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.OrderedItemSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.OrderedItemSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class SampleTest { internal static class OrderedItemSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("ItemName", typeof(Serde.Test.SampleTest.OrderedItem).GetField("ItemName")!), ("Description", typeof(Serde.Test.SampleTest.OrderedItem).GetField("Description")!), ("UnitPrice", typeof(Serde.Test.SampleTest.OrderedItem).GetField("UnitPrice")!), diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.PurchaseOrderSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.PurchaseOrderSerdeTypeInfo.cs index 9d6a453e..9c10e0a1 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.PurchaseOrderSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.SampleTest.PurchaseOrderSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class SampleTest { internal static class PurchaseOrderSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("ShipTo", typeof(Serde.Test.SampleTest.PurchaseOrder).GetField("ShipTo")!), ("OrderDate", typeof(Serde.Test.SampleTest.PurchaseOrder).GetField("OrderDate")!), ("Items", typeof(Serde.Test.SampleTest.PurchaseOrder).GetField("OrderedItems")!), diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.BoolStructSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.BoolStructSerdeTypeInfo.cs index aacc961b..1d3d552f 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.BoolStructSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.BoolStructSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class XmlTests { internal static class BoolStructSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("BoolField", typeof(Serde.Test.XmlTests.BoolStruct).GetField("BoolField")!) }); } diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.MapTest1SerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.MapTest1SerdeTypeInfo.cs index 0c1ae304..4607ccae 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.MapTest1SerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.MapTest1SerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class XmlTests { internal static class MapTest1SerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("MapField", typeof(Serde.Test.XmlTests.MapTest1).GetField("MapField")!) }); } diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.NestedArraysSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.NestedArraysSerdeTypeInfo.cs index eb0e70f0..65931194 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.NestedArraysSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.NestedArraysSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class XmlTests { internal static class NestedArraysSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("A", typeof(Serde.Test.XmlTests.NestedArrays).GetField("A")!) }); } diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.StructWithIntFieldSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.StructWithIntFieldSerdeTypeInfo.cs index e4fac483..769890aa 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.StructWithIntFieldSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.StructWithIntFieldSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class XmlTests { internal static class StructWithIntFieldSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("X", typeof(Serde.Test.XmlTests.StructWithIntField).GetProperty("X")!) }); } diff --git a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.TypeWithArrayFieldSerdeTypeInfo.cs b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.TypeWithArrayFieldSerdeTypeInfo.cs index ad67a4aa..267b9c2b 100644 --- a/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.TypeWithArrayFieldSerdeTypeInfo.cs +++ b/test/Serde.Xml.Test/generated/SerdeGenerator/Serde.SerdeImplRoslynGenerator/Serde.Test.XmlTests.TypeWithArrayFieldSerdeTypeInfo.cs @@ -3,7 +3,9 @@ partial class XmlTests { internal static class TypeWithArrayFieldSerdeTypeInfo { - internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create(new (string, System.Reflection.MemberInfo)[] { + internal static readonly Serde.TypeInfo TypeInfo = Serde.TypeInfo.Create( + Serde.TypeInfo.TypeKind.CustomType, + new (string, System.Reflection.MemberInfo)[] { ("ArrayField", typeof(Serde.Test.XmlTests.TypeWithArrayField).GetField("ArrayField")!) }); }