Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize wrappers and fix broken float codegen #200

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/generator/Wrappers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ readonly partial struct {{wrapperName}} { }
SpecialType.System_Int32 => "Int32Wrap",
SpecialType.System_Int64 => "Int64Wrap",
SpecialType.System_String => "StringWrap",
SpecialType.System_Single => "FloatWrap",
SpecialType.System_Single => "SingleWrap",
SpecialType.System_Double => "DoubleWrap",
SpecialType.System_Decimal => "DecimalWrap",
_ => null
Expand Down
14 changes: 7 additions & 7 deletions src/serde/Wrappers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace Serde;
void ISerialize<T>.Serialize(T value, ISerializer serializer) => value.Serialize(value, serializer);
}

public readonly partial record struct BoolWrap
public readonly partial struct BoolWrap
: ISerialize<bool>, IDeserialize<bool>
{
public static ISerdeInfo SerdeInfo { get; } = Serde.SerdeInfo.MakePrimitive(s_typeName);
Expand Down Expand Up @@ -168,7 +168,7 @@ private sealed class SerdeVisitor : IDeserializeVisitor<long>
}
}

public readonly record struct SingleWrap : ISerialize<float>, IDeserialize<float>
public readonly struct SingleWrap : ISerialize<float>, IDeserialize<float>
{
public static ISerdeInfo SerdeInfo { get; } = Serde.SerdeInfo.MakePrimitive("float");
public void Serialize(float value, ISerializer serializer)
Expand All @@ -177,7 +177,7 @@ public static float Deserialize(IDeserializer deserializer)
=> deserializer.ReadFloat();
}

public readonly partial record struct DoubleWrap
public readonly partial struct DoubleWrap
: ISerialize<double>, IDeserialize<double>
{
public static ISerdeInfo SerdeInfo { get; } = Serde.SerdeInfo.MakePrimitive("double");
Expand Down Expand Up @@ -263,7 +263,7 @@ private ArgumentOutOfRangeException GetOOR(int index)

public static class NullableWrap
{
public readonly partial record struct SerializeImpl<T, TWrap> : ISerialize<T?>
public readonly partial struct SerializeImpl<T, TWrap> : ISerialize<T?>
where T : struct
where TWrap : struct, ISerialize<T>
{
Expand All @@ -281,7 +281,7 @@ public static class NullableWrap
}
}

public readonly partial record struct DeserializeImpl<T, TWrap>
public readonly partial struct DeserializeImpl<T, TWrap>
: IDeserialize<T?>
where T : struct
where TWrap : IDeserialize<T>
Expand Down Expand Up @@ -311,7 +311,7 @@ private sealed class Visitor : IDeserializeVisitor<T?>

public static class NullableRefWrap
{
public readonly partial record struct SerializeImpl<T, TWrap> : ISerialize<T?>
public readonly partial struct SerializeImpl<T, TWrap> : ISerialize<T?>
where T : class
where TWrap : struct, ISerialize<T>
{
Expand All @@ -330,7 +330,7 @@ public static class NullableRefWrap
}
}

public readonly partial record struct DeserializeImpl<T, TWrap>(T? Value)
public readonly partial struct DeserializeImpl<T, TWrap>
: IDeserialize<T?>
where T : class
where TWrap : IDeserialize<T>
Expand Down
Loading