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
{{ message }}
Repository navigation
Function signature mismatch when calling native WASM function that takes i64/long #112262
An Uncaught RuntimeError: null function or function signature mismatch is thrown when attempting to call a [DllImport]ed function that takes an enum with ulong variant on WASM.
I think we historically have some limitations around enums and basetypes, so this is probably one of those cases. I know JS interop previously treated all enums as int32 so it doesn't surprise me that the same is true for pinvoke.
For now, please use the workaround, but we'll definitely keep this issue open and try to fix it.
Activity
lewing commentedon Feb 9, 2025
@kg any idea what might be going wrong here?
kg commentedon Feb 9, 2025
Does it work if you cast the enum to uint64 and make the signature of the pinvoke uint64?
r58Playz commentedon Feb 9, 2025
Yes, it works fine if I do that.
kg commentedon Feb 9, 2025
I think we historically have some limitations around enums and basetypes, so this is probably one of those cases. I know JS interop previously treated all enums as int32 so it doesn't surprise me that the same is true for pinvoke.
For now, please use the workaround, but we'll definitely keep this issue open and try to fix it.
[mono][wasm] Fix pinvoke with 64-bit enum argument (#131021)