Skip to content

Commit

Permalink
Remove remnant of old code
Browse files Browse the repository at this point in the history
No longer any reason to handle delegates specifically : it will be done
naturally by the marshallerCache (and who knows, maybe it *can*
serialize some delegates !).
Moreover, this could misinterpret a signature as valid without parameter,
with somewhat weird consequences.
  • Loading branch information
lanfeust69 committed Oct 14, 2021
1 parent 510abd8 commit 5a1608d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/protobuf-net.Grpc/Internal/ContractOperation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Reflection;
using Grpc.Core;
Expand Down Expand Up @@ -179,8 +179,6 @@ static TypeCategory GetCategory(MarshallerCache marshallerCache, Type type, IBin
if (genType == typeof(AsyncServerStreamingCall<>)) return TypeCategory.AsyncServerStreamingCall;
}

if (typeof(Delegate).IsAssignableFrom(type)) return TypeCategory.None; // yeah, that's not going to happen

if (marshallerCache.CanSerializeType(type)) return TypeCategory.Data;
bindContext?.LogWarning("Type cannot be serialized; ignoring: {0}", type.FullName);
return TypeCategory.Invalid;
Expand All @@ -205,7 +203,7 @@ internal static bool TryIdentifySignature(MethodInfo method, BinderConfiguration
if (method.IsGenericMethodDefinition) return false; // can't work with <T> methods

if ((method.Attributes & (MethodAttributes.SpecialName)) != 0) return false; // some kind of accessor etc

if (!binderConfig.Binder.IsOperationContract(method, out var opName)) return false;

var args = method.GetParameters();
Expand Down

0 comments on commit 5a1608d

Please sign in to comment.