Skip to content

(Unmanaged) Structs are not considered blittable by Emscripten / Blazor WASM AOT #61146

Closed
@HurricanKai

Description

@HurricanKai

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

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions