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

Clarify Vector usage #490

Open
Nadrieril opened this issue Dec 11, 2024 · 1 comment
Open

Clarify Vector usage #490

Nadrieril opened this issue Dec 11, 2024 · 1 comment
Assignees

Comments

@Nadrieril
Copy link
Member

A Vector<I, T> is secretly an IndexVec<I, Option<T>>. There's something slightly misleading there: sometimes (e.g. in GenericParams) we expect all the values to be Some, sometimes (e.g. in the top-level fun_decls etc arrays) we intentionally allow for missing entries.

We should clarify the intent by splitting it into IndexVec and IndexMap, where the first one does not allow for vacant entries. When converting to OCaml we manually convert the map cases to a map anyway, so this will give us a more principled reason to do so.

@Nadrieril Nadrieril self-assigned this Dec 11, 2024
@sonmarcho
Copy link
Member

I 100% support this. ;)

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

No branches or pull requests

2 participants