-
Notifications
You must be signed in to change notification settings - Fork 52
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
Unable to create a function with parameter when Type.IsValueType is true #174
Comments
Hi @hiinaspace: The intention behind this is that As I think you'll have to stick with using |
At a bare minimum, we should improve this exception message to note that it's because the type is a value type and .NET types are required to be reference types to work with |
I see, thanks for the clarification. My java background assuming that all non-primitives are references doesn't work in c#... I agree that a better error message would be nice, in lieu of autoboxing. |
I have a really simple adaption of the externref sample, running inside unity 2021.3, whose csharp runtime is ostensibly .NET standard 2.1 compatible:
However, as written, I get
If I change the function argument type from
Vector3
to justobject
and do the cast manually, it works as expected. Looks like it's because it falls out of Value.TryGetKind atwasmtime-dotnet/src/Value.cs
Line 210 in 387edd2
Type.IsValueType == true
.Is that test of IsValueType necessary? I don't know if this is just a weird unity environment thing.
The text was updated successfully, but these errors were encountered: