Skip to content

Generate doesn't import packages referenced in type args #260

Open
@Ralph7C2

Description

If an interface method or function uses a generic type with a specified type parameter, like:

type SomeInterface interface {
    Do(o Optional[pkg.SomeType])
}

The generated file will use Optional[pkg.SomeType], but not import pkg.

While there is a lot more work to fully support generic interfaces, this would improve interfaces that handle other generic types.

I've created a PR that fixes this: #258

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions