I have one but it uses cecil objects to do it On Tue, Aug 2, 2011 at 3:45 PM, Fabian Schmied <[email protected]> wrote: >> class Base<T> { >> public virtual void M(List<T> p) {} >> } >> class Derived<T,S> : Base<S[]> { >> public override void M(List<S[]> p) {} >> } >> >> If you compare the signatures of the two method definitions, they won't >> match. >> You would have to construct the instantiated method "Base<S[]>.M" >> (perform type substitution in all method parameters) in order to get the >> same method signature. > > I wonder if the linker code linked above > ("https://github.com/mono/mono/blob/master/mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs") > handles this scenario correctly - can't really dig into it right now, > but at first glance, it doesn't seem to. Actually, it apparently > simply calls Resolve on the base type, without special handling of > GenericInstanceTypes. > > I guess if someone has already implemented a complete overridden > method/interface implementation matcher that exactly matches the CLI > specs, that would definitely make a nice Rock. > > You're right, though: to use a signature string for base method > matching, you'd need to construct a type Base<S[]> whose members have > substituted types and call the base signature strings for those. Which > is what Reflection gives you when you call Type.BaseType in such a > scenario, by the way; so one could argue that it would be nice if > Cecil could do this automatically, too. It doesn't really match > Cecil's "we just represent the metadata" philosophy, though. > > Fabian > > -- > -- > mono-cecil
-- Le doute n'est pas une condition agréable, mais la certitude est absurde. -- -- mono-cecil
