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
This produces warnings if any of the fields is annotated. Would it make more sense to warn at the callsites to the interop method? Currently the origin is the interop method itself, which is unusual in cases where the required fields depend on the callsite - see dotnet/runtime#56593 (comment).
This is not a user scenario - it's some quirk for Mono.
P/invoke cannot be an instance method on CoreCLR and InternalCall is only used on COM classes that cannot have fields anyway. You'll get a TypeLoadException on this with CoreCLR.
I don't think we need to bother with this scenario.
Currently when the linker sees a PInvoke or InternalCall that is an instance method it preserves all fields of the declaring type: https://github.com/mono/linker/blob/762278c9c3e60f5a82733dc0386bd0cf7f0a2d22/src/linker/Linker.Steps/MarkStep.cs#L3266
This produces warnings if any of the fields is annotated. Would it make more sense to warn at the callsites to the interop method? Currently the origin is the interop method itself, which is unusual in cases where the required fields depend on the callsite - see dotnet/runtime#56593 (comment).
@MichalStrehovsky @LakshanF
The text was updated successfully, but these errors were encountered: