Describe The Bug
Consider these type hierarchies:
DerivedGeneric<T>: Base<T>
DerivedNoGeneric : Base<int>
Lets assume there is a BaseCodec<T> for Base<T> lets assume there is not a codec for DerivedGeneric and DerivedNoGeneric in this example.
serializer.CanSerialize(typeof(DerivedGeneric<R>)) returns false
serializer.CanSerialize(typeof(DerivedNoGeneric)) throws: System.ArgumentException : The number of generic arguments provided doesn't equal the arity of the generic type definition. (Parameter 'instantiation')
CodecProvider tries to instantiate a base codec using the generic arguments of the parent type, which works when the parent has generic arguments but not when it doesn't.