Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes enums are not blittable on Blazor WASM #61350

Closed
mattleibow opened this issue Nov 9, 2021 · 2 comments
Closed

Sometimes enums are not blittable on Blazor WASM #61350

mattleibow opened this issue Nov 9, 2021 · 2 comments
Labels
arch-wasm WebAssembly architecture untriaged New issue has not been triaged by the area owner

Comments

@mattleibow
Copy link
Member

Description

I have this pinvoke code:

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate UnicodeGeneralCategory UnicodeGeneralCategoryProxyDelegate(IntPtr ufuncs, UInt32 unicode, void* user_data);

And compiler gives this:

C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.0\Sdk\WasmApp.Native.targets(239,5): error : The return type 'BlazorApp8.UnicodeGeneralCategory' of pinvoke callback method 'BlazorApp8.UnicodeGeneralCategory GeneralCategoryProxyImplementation(System.IntPtr, System.UInt32, System.Void*)' needs to be blittable.

Reproduction Steps

BlazorApp8.zip

Expected behavior

Compiles

Actual behavior

Error

Regression?

Probably not.

Known Workarounds

Make the return type an int and then cast to an enum.

Configuration

No response

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 9, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@radical
Copy link
Member

radical commented Nov 9, 2021

Dupe of #61144 .

@radical radical closed this as completed Nov 9, 2021
@radical radical added the arch-wasm WebAssembly architecture label Nov 9, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

2 participants