void Test()
{
PInvokeWithResult();
}
// IL2026 - Foo
[DllImport("nonexistent")]
static extern ResultType PInvokeWithResult();
class ResultType {
[RequiresUnreferencedCode("Foo")]
public ResultType() { }
}
Types used in PInvoke are potentially instantiated by the runtime via default .ctors. Thus if the .ctor is annotated with RUC this should cause a warning.
This is probably a very low priority thing to fix in the analyzer, since this would be very uncommon.
Types used in PInvoke are potentially instantiated by the runtime via default .ctors. Thus if the .ctor is annotated with RUC this should cause a warning.
This is probably a very low priority thing to fix in the analyzer, since this would be very uncommon.