protobuf-net / protobuf-net.Grpc

GRPC bindings for protobuf-net and grpc-dotnet
Other
846 stars 106 forks source link

Issue with reflection of type IDictionary<double, List<int>>? - results in error #289

Open JuliusSweetland opened 1 year ago

JuliusSweetland commented 1 year ago

Attempting to reflect an interface with this type:

[ProtoMember(20)]
public IDictionary<double, List<int>>? MyProperty { get; set; }

Using this command:

dotnet grpc-cli dump http://localhost:5000 MyService

Results in this error message:

Error: MyService.KeyValuePair_Double_List_Int32.Value: "List_Int32" is not defined.

Experimenting with the type of this property...

This fails with the same error:

[ProtoMember(20)]
public (double, List<int>) MyProperty { get; set; }

This fails with the same error:

[ProtoMember(20)]
public IList<(double, IList<int>)> MyProperty { get; set; }

This works:

[ProtoMember(20)]
public IList<(double, int)> MyProperty { get; set; }

This works:

[ProtoMember(20)]
public IDictionary<double, int> MyProperty { get; set; }

Is it something about the nested generic types?

JuliusSweetland commented 1 year ago

@mgravell

mgravell commented 1 year ago

Nope; I saw it initially - looks very curious, but I have not yet had chance to investigate. I'm intrigued - I just don't have infinite time :)

JuliusSweetland commented 1 year ago

Is anyone able to give a bit of guidance on this one? Thanks.