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

Added TableKind for tables #262

Merged
merged 4 commits into from
Jul 5, 2023
Merged

Conversation

martindevans
Copy link
Contributor

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).

…sents the range of type a `Table` may contain.
…ind` to steer people towards the new constructor.
Copy link
Member

@peterhuene peterhuene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

However, there are some tests that are generating the obsolete warning by using ValueKind still; we should probably fix that as part of this PR.

@martindevans
Copy link
Contributor Author

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

@peterhuene peterhuene merged commit cf0ef9d into bytecodealliance:main Jul 5, 2023
@martindevans martindevans deleted the TableKind branch July 5, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants