Skip to content

Custom types can cause multiple imports #2807

@bendk

Description

@bendk

For many bindings, our custom type configuration can specify imports to add in order to support the custom type. The bindings code de-dupes these to avoid duplicate imports, however it doesn't take into account imports that are always present in the generated code. If a user specified one of these modules it would result in a duplicate import, which may be messy or may even prevent compilation. If a user doesn't specify the module because of this, then their bindings may be broken by a UniFFI upgrade that removes the import.

I think the solution is to put all imports from all sources into a BTreeSet to de-duplicate them.

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