Skip to content

Cannot use function name "encrypt" #187

@SaritNike

Description

@SaritNike

If I take the example hello.wit from the README and just change the name of the function from hello to encrypt and do the same in app.py, I get a linker error:

thread '' (19152) panicked at C:\Users\runneradmin.cargo\git\checkouts\wasm-tools-83155cefafadb9f3\e2bb0a2\crates\wit-component\src\linking.rs:237:9: one or more duplicate items detected when collecting into set or map

app.py:

import wit_world

class WitWorld(wit_world.WitWorld):
    def encrypt(self) -> str:
        return "Hello, World!"

hello.wit:

package example:hello;
world hello {
  export encrypt: func() -> string;
}

When I change the function name to anything else (e.g. xencrypt) it works. When I write the guest-code directly in Rust, there is no issue with the function name encrypt. Is it a reserved keyword?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions