Skip to content

Find defined type id used in remapping in ItemKind::Type#64

Merged
peterhuene merged 1 commit intobytecodealliance:apifrom
rylev:another-defined-type
Apr 4, 2024
Merged

Find defined type id used in remapping in ItemKind::Type#64
peterhuene merged 1 commit intobytecodealliance:apifrom
rylev:another-defined-type

Conversation

@rylev
Copy link
Copy Markdown
Collaborator

@rylev rylev commented Apr 4, 2024

I was running into a panic expected a defined type where the kind was a ItemKind::Type(Type::Value(ValueType::Defined(_))).

It seems that at the end of remap_defined_type, we're inserting ItemKind::Type(Type::Value(ValueType::Defined(id))) into the aggregated map and so we should always expect to get these defined types with a ItemKind::Type(Type::Value(ValueType::Defined(_))) key.

This does seem to fix the issue though I'm not sure what the consequences if any of always storing things as ItemKind:::Type vs. ItemKind::Value.

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev requested a review from peterhuene April 4, 2024 12:25
Copy link
Copy Markdown
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.

Thanks for catching that!

@peterhuene peterhuene merged commit a059231 into bytecodealliance:api Apr 4, 2024
@rylev rylev deleted the another-defined-type branch April 4, 2024 15:02
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