asynkron / Wire

Binary serializer for POCO objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AmbiguousMatchException when serializing a type with multiple AddRange methods

mellinoe opened this issue Β· comments

Disclaimer: I'm still in the very early, experimental stage of trying to integrate Wire into my project, so I am most likely still doing many things wrong with the library. πŸ˜„

One issue I'm hitting is that a type I'm (attempting to) serialize has multiple AddRange methods. This results in an AmbiguousMatchException on this line. More interestingly, none of the overloads actually take an IEnumerable<T>, so even if one was chosen, it looks like the code further on would also fail, because an array is passed into the method. The type does have an Add method taking a single T.

Perhaps the code could be changed to:

  • Find all AddRange methods
  • Pick one with the most acceptable parameter type
  • Fall back to Add if nothing is found

Good catch, I'm on it