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

Fix typo in ReadValue args #209

Merged
merged 2 commits into from
Dec 17, 2024
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
18 changes: 6 additions & 12 deletions src/serde/IDeserialize.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;

namespace Serde;

Expand Down Expand Up @@ -97,8 +91,8 @@ public interface IDeserializeCollection
{
int? SizeOpt { get; }

bool TryReadValue<T, TProxy>(ISerdeInfo typeInfo, TProxy deserialize, [MaybeNullWhen(false)] out T next)
where TProxy : IDeserialize<T>;
bool TryReadValue<T, D>(ISerdeInfo typeInfo, D deserialize, [MaybeNullWhen(false)] out T next)
where D : IDeserialize<T>;
}

public interface IDeserializeType
Expand All @@ -116,7 +110,7 @@ public interface IDeserializeType
/// </summary>
int TryReadIndex(ISerdeInfo map, out string? errorName);

T ReadValue<T>(int index, IDeserialize<T> deserialize);
T ReadValue<T, D>(int index, D deserialize) where D : IDeserialize<T>;

void SkipValue();

Expand All @@ -141,7 +135,7 @@ public static class IDeserializeTypeExt
public static T ReadValue<T, TProvider>(this IDeserializeType deserializeType, int index)
where TProvider : IDeserializeProvider<T>
{
return deserializeType.ReadValue(index, TProvider.DeserializeInstance);
return deserializeType.ReadValue<T, IDeserialize<T>>(index, TProvider.DeserializeInstance);
}
}

Expand All @@ -157,9 +151,9 @@ public interface IDeserializer : IDisposable
T ReadAny<T>(IDeserializeVisitor<T> v)
where T : class;

T? ReadNullableRef<T, TProxy>(TProxy proxy)
T? ReadNullableRef<T, D>(D deserialize)
where T : class
where TProxy : IDeserialize<T>;
where D : IDeserialize<T>;

bool ReadBool();
char ReadChar();
Expand Down
2 changes: 1 addition & 1 deletion src/serde/json/JsonDeserializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void IDisposable.Dispose()

partial class JsonDeserializer<TReader> : IDeserializeType
{
T IDeserializeType.ReadValue<T>(int index, IDeserialize<T> d)
T IDeserializeType.ReadValue<T, D>(int index, D d)
{
ReadColon();
return d.Deserialize(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[
{
"Id": "CS0311",
"Id": "CS7036",
"Title": "",
"Severity": "Error",
"WarningLevel": "0",
"Location": "SerdeGenerator/Serde.SerdeImplRoslynGenerator/Container.IDeserialize.cs: (23,52)-(23,79)",
"HelpLink": "https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS0311)",
"MessageFormat": "The type '{3}' cannot be used as type parameter '{2}' in the generic type or method '{0}'. There is no implicit reference conversion from '{3}' to '{1}'.",
"Message": "The type 'Proxy' cannot be used as type parameter 'TProvider' in the generic type or method 'IDeserializeTypeExt.ReadValue<T, TProvider>(IDeserializeType, int)'. There is no implicit reference conversion from 'Proxy' to 'Serde.IDeserializeProvider<Original?>'.",
"HelpLink": "https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS7036)",
"MessageFormat": "There is no argument given that corresponds to the required parameter '{0}' of '{1}'",
"Message": "There is no argument given that corresponds to the required parameter 'deserialize' of 'IDeserializeType.ReadValue<T, D>(int, D)'",
"Category": "Compiler"
}
]
Loading