Closed
Description
The trimmer will look for the first method with a matching signature for an interface method implementation, even if there is a methodImpl for that method. This will keep the method, even though it's not needed.
public static void Main ()
{
IFoo f = new FooWithImpl ();
f.Method ();
f = new FooWithBase ();
f.Method ();
}
[Kept]
interface IFoo
{
[Kept]
void Method ();
}
[Kept]
[KeptMember (".ctor()")]
class BaseFoo
{
[Kept] // Should not be kept, but TypeMapInfo finds it as the first method with matching signature
public virtual void Method ()
{
}
}
[Kept]
[KeptMember (".ctor()")]
[KeptBaseType (typeof (BaseFoo2))]
[KeptInterface (typeof (IFoo))]
class FooWithBase : BaseFoo, IFoo
{
[Kept]
void IFoo.Method () { }
}
[Kept]
[KeptInterface(typeof(IFoo))]
class FooWithImpl : IFoo
{
[Kept]
void IFoo.Method() { }
[Kept] // Should not be kept
public virtual void Method() { }
}
Metadata
Metadata
Assignees
Type
Projects
Status
No status