Skip to content

fix: report unknown parents instead of panicking - #1

Open
matthargett wants to merge 1 commit into
mainfrom
fix/unknown-parent
Open

matthargett wants to merge 1 commit into
mainfrom
fix/unknown-parent

Conversation

@matthargett

@matthargett matthargett commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Staged for upstream wasi-gfx/webidl2wit (bug fix, no prior issue needed per CONTRIBUTING; closes wasi-gfx#55).

An interface or dictionary that inherits from a type absent from the input, as happens whenever one specification's IDL is converted without the specifications it builds on, made handle_resource_inheritance and handle_record_inheritance unwrap a missing lookup and panic.

The lookups now follow HandleUnsupported:

  • Bail returns an error naming the child and the missing parent, so webidl_to_wit fails instead of aborting the process;
  • Skip and Warn leave the child without the inherited members and without the as-* conversions for that parent.

Tests: unknown-parent fixture under Warn + Both, and an assertion that the default Bail mode returns Err. cargo test and cargo fmt --check pass.

Submitted upstream as wasi-gfx#64.

An interface or dictionary that inherits from a type absent from the input
(declared by another specification) made `handle_resource_inheritance` and
`handle_record_inheritance` unwrap a missing lookup and panic. The lookups
now follow `HandleUnsupported`: `Bail` returns an error naming the child
and the missing parent, `Skip` and `Warn` leave the child without the
inherited members and without the `as-*` conversions for that parent.

Fixes wasi-gfx#55.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T02:11:36.712035Z 4d58a63 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

Panic if find parent fails

1 participant