Skip to content

fix: emit bindings for imported resources without methods - #357

Open
carsonfarmer wants to merge 1 commit into
bytecodealliance:mainfrom
carsonfarmer:cf/opaque-resource-bindings
Open

carsonfarmer wants to merge 1 commit into
bytecodealliance:mainfrom
carsonfarmer:cf/opaque-resource-bindings

Conversation

@carsonfarmer

@carsonfarmer carsonfarmer commented Sep 26, 2026 •

Copy link
Copy Markdown

Functions returning an imported resource with no methods throw ReferenceError because the compiler never generates its class.

Generate classes for declared resources, including those without constructors or methods. Add a regression that returns and borrows one, then checks that disposing it calls the host destructor once.

Fixes #221.

Seed resource function groups from imported resource types so opaque handles receive the existing class and disposal bindings. Add an ownership, borrowing, and disposal regression.

Co-authored-by: Codex <noreply@openai.com>
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.

ReferenceError when resource has no functions

1 participant