Skip to content

Some bugs#1

Draft
ludfjig wants to merge 4 commits intoandreiltd:mainfrom
ludfjig:some_bugs
Draft

Some bugs#1
ludfjig wants to merge 4 commits intoandreiltd:mainfrom
ludfjig:some_bugs

Conversation

@ludfjig
Copy link

@ludfjig ludfjig commented Mar 16, 2026

While trying to learn this repo I had ai help see if there's any bugs. Here are some findings with suggested bug fixes. Feel free to close this PR and implement differently too

ludfjig added 4 commits March 16, 2026 14:07
- bug_static_method_ignores_interface: static resource methods look up
  in globals instead of the interface object
- bug_async_export_rejection_swallowed: void async export rejection is
  silently swallowed via task_return with empty stack
- bug_root_level_flags_dropped: partition_imports skips root-level
  flags/enums/variants defined directly in a world

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
The [static] handler looked up the method directly in globals,
ignoring func.interface(). This meant static methods on resources
inside an interface would fail at runtime.

Mirror the constructor/method pattern: when func.interface() is
Some, look up the resource class from the interface object first.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
The catch_cb closure called task_return with an empty value stack,
which silently swallowed rejections for void async exports. Replace
with a panic that includes the JS error message so the host sees a
trap instead of a false Ok.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
partition_imports guarded flags, enums, and variants with
if *.interface().is_some(), silently dropping any defined at the
world root level. The WIT spec allows typedef-item inside a world,
so remove the guards to match how functions are already handled.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.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.

1 participant