Skip to content

Bindings generation with named-imports and unstable WIT features does not work #14332

Description

@alexcrichton

This example:

wasmtime::component::bindgen!({
    inline: "
    package wasmtime:test;

    world test {
        import a: wasi:sockets/network@0.2.12;
    }
    ",
    path: "src/p2/wit",
    world: "wasmtime:test/test",
    with: {
        "wasi:sockets/network": wasmtime_wasi::p2::bindings::sockets::network,
    },
    named_imports: {
        "wasi:sockets/network": wasmtime_wasi::NamedId,
    },
});

fails with:

error[E0616]: field `network_error_code` of struct `wasmtime_wasi::p2::bindings::sockets::network::LinkOptions` is private
   --> crates/wasi/tests/all/p2/async_.rs:580:1
    |
580 | / wasmtime::component::bindgen!({
581 | |     inline: "
582 | |     package wasmtime:test;
...   |
595 | |     },
596 | | });
    | |__^ private field
    |
    = note: this error originates in the macro `wasmtime::component::bindgen` (in Nightly builds, run with -Z macro-backtrace for more info)
help: a method `network_error_code` also exists, call it with parentheses
    |
596 | })(_);

Originally reported at #14275 (review)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wasm-proposal:component-modelIssues related to the WebAssembly Component Model proposal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions