-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Methods attributed with LibraryImportAttribute are implicitly unsafe. Although the marshalling logic could be analyzed to be considered memory-safe, the compiler cannot validate that the underlying extern DllImport is targeting a method with a valid signature.
Today, the stubs generated by LibraryImportGenerator will not generate the RequiresUnsafeAttribute on the produced stubs. This causes inconsistency with stubs that have no marshalling (they are just a raw DllImport, which is extern).
The LibraryImportGenerator should add the RequiresUnsafeAttribute to all generated stubs to provide a consistent experience.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
No status