Skip to content

wit-parser: don't panic on a re-exported imported resource#2526

Merged
pchickey merged 1 commit into
bytecodealliance:mainfrom
eyupcanakman:fix/decode-reexport-imported-resource-2506
May 22, 2026
Merged

wit-parser: don't panic on a re-exported imported resource#2526
pchickey merged 1 commit into
bytecodealliance:mainfrom
eyupcanakman:fix/decode-reexport-imported-resource-2506

Conversation

@eyupcanakman
Copy link
Copy Markdown
Contributor

validate accepts a component that imports a resource-bearing instance and re-exports it under a new name, but component wit panicked on an assert! while decoding it. WIT can't represent a re-exported imported resource. Return a structured error instead of panicking, and add a cli test for the panic plus one for the same import without the re-export, which still decodes.

Closes #2506

`validate` accepts a component that imports a resource-bearing instance and re-exports it under a new name, but `component wit` panicked on an `assert!` while decoding it. WIT can't represent a re-exported imported resource. Return a structured error instead of panicking, and add a cli test for the panic plus one for the same import without the re-export, which still decodes.

Closes bytecodealliance#2506
@eyupcanakman eyupcanakman requested a review from a team as a code owner May 22, 2026 20:33
@eyupcanakman eyupcanakman requested review from pchickey and removed request for a team May 22, 2026 20:33
Copy link
Copy Markdown
Contributor

@pchickey pchickey left a comment

Choose a reason for hiding this comment

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

Thank you!

@pchickey pchickey added this pull request to the merge queue May 22, 2026
Merged via the queue into bytecodealliance:main with commit 2b0ff17 May 22, 2026
37 checks passed
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.

wit-parser panic on import + re-export of resource-bearing instance

2 participants