bytecodealliance / wasmtime-dotnet

.NET embedding of Wasmtime https://bytecodealliance.github.io/wasmtime-dotnet/
Apache License 2.0
409 stars 52 forks source link

Added `TableKind` for tables #262

Closed martindevans closed 1 year ago

martindevans commented 1 year ago

Replaced ValueKind with TableKind in Table. This properly represents the range of type a Table may contain. I've minimised the amount of breakage by still accepting ValueKind in the constructor (marked with an Obsolete attribute, to steer peope towards the new constructor).

This is a small improvement (it provides a hint at valid table types) but it is still a bit fragile. It's very easy to use an incorrect Kind or to pass an incorrect type into SetElement. We may want to improve on that in the future (e.g. type safe table wrappers, like we have for globals).

martindevans commented 1 year ago

Oh sorry, I must have missed those. I'll fix them now.