Closed
Description
Description
Unmanaged structs are not considered blittable and therefore cannot be used in pinvoke callbacks.
Reproduction Steps
Attempt to compile code like
public struct S { public int Value; }
[UnmanagedCallersOnly]
public void M(S myStruct) { }
using Emscripten / WASM AOT
Expected behavior
The above code should compile.
Actual behavior
An error is shown, structs are not considered blittable.
Regression?
No response
Known Workarounds
No response
Configuration
Tested on .NET 6 RC2
Other information
No response
Metadata
Metadata
Labels
Type
Projects
Status
Done