Let me add, that if you add an override to the method Base::A() then peverify will fail to load both type Class and Base.
On 16 Wrz, 16:58, Janusz Lembicz <[email protected]> wrote: > Ok, let me put it differently. How to specify using Cecil API that the > Class implements method IClass::A() with the inherited B:A() method > (sorry for the mistake in the first post), when the methods have > different names (and of course the same signature)? Should be possible > according to the specification. > > Janusz > > On 16 Wrz, 14:05, Jb Evain <[email protected]> wrote: > > > > > > > > > Hey, > > > I suggest you compile your sample (obviously, you'll have to fix it first > > to make Class extend Base) and have a look at the metadata produced using > > ildasm/monodis. > > > There's no link between a TypeDef row and a MethodImpl row, so Class does > > need to have a method which overrides IClass.A. > > > Jb > > > On Sep 15, 2011, at 11:25 PM, Janusz Lembicz wrote: > > > > From what I can see Cecil API doesn't allow to create a row in the > > > MethodImpl table for the type that implements an interface, but the > > > method that override an interface method come from it's base type. > > > > public interface IClass > > > { > > > void A(); > > > } > > > > public class Base > > > { > > > public void A() {} > > > } > > > > public class Class : IClass > > > { > > > } > > > > Is that intentional? I'd like to be able to specify in the type Class > > > that method A() from the interface IClass is implemented by method A > > > from the type Base, what is valid according to ECMA-335 22.27, in case > > > one of them happened to be renamed. Please let me know if I'm getting > > > something wrong here. Thanks. > > > > -- > > > -- > > > mono-cecil -- -- mono-cecil
