Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the type-driven ability for duplicates in a Linker #2789

Merged

Commits on Mar 29, 2021

  1. Remove the type-driven ability for duplicates in a Linker

    When `Linker` was first created it was attempted to be created with the
    ability to instantiate any wasm modules, including those with duplicate
    import strings of different types. In an effort to support this a
    `Linker` supports defining the same names twice so long as they're
    defined with differently-typed values.
    
    This ended up causing wast testsuite failures module linking is enabled,
    however, because the wrong error message is returned. While it would be
    possible to fix this there's already the possibility for confusing error
    messages today due to the `Linker` trying to take on this type-level
    complexity. In a way this is yet-another type checker for wasm imports,
    but sort of a bad one because it only supports things like
    globals/functions, and otherwise you can only define one `Memory`, for
    example, with a particular name.
    
    This commit completely removes this feature from `Linker` to simplify
    the implementation and make error messages more straightforward. This
    means that any error message coming from a `Linker` is purely "this
    thing wasn't defined" rather than a hybrid of "maybe the types didn't
    match?". I think this also better aligns with the direction that we see
    conventional wasm modules going which is that duplicate imports are not
    ever present.
    alexcrichton committed Mar 29, 2021
    Configuration menu
    Copy the full SHA
    dcfc3d2 View commit details
    Browse the repository at this point in the history