You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently linker will keep the interface if there's a method which implements one of the static interface methods on it and that implementation method is kept. This is unlike non-static interface methods where the same situation still allows the linker to remove the interface.
Sample:
voidMain(){
TestClass.Method();// Use the implementation method only}[Kept]// ??? WhyinterfaceIStaticIFace{[Kept]// ??? WhystaticabstractMethod();}[Kept]// This is correctclassTestClass:IStaticIFace{[Kept]// This is correctpublicstaticabstractMethod(){};}
The text was updated successfully, but these errors were encountered:
I debugged this a little. The main difference is that non-static methods implement the interface method implicitly - there's no override in the IL metadata. Static interface method implementation do have an explicit override in the metadata. Currently linker if method has overrides marks those overrides (and interfaces they belong to) without any additional logic.
This needs a bit of investigation:
Is it OK to not keep the interface/method in this case? Will Cecil do the right thing with metadata if linker removed them?
How to implement such behavior - linker would explicitly ignore override in the IL metadata - this might need careful handling
Currently linker will keep the interface if there's a method which implements one of the static interface methods on it and that implementation method is kept. This is unlike non-static interface methods where the same situation still allows the linker to remove the interface.
Sample:
The text was updated successfully, but these errors were encountered: