Skip to content

Don't warn for type aliases #61

@jdemeyer

Description

@jdemeyer

Consider

type foo = int

func testUnconvert() {
    var x int = 42
    _ = foo(x)
}

unconvert flags this as "unnecessary conversion". But when looking at that code, there may a good reason for the fake "conversion": it could be an implementation detail that foo and int are aliases, it could be that foo and int are used for different purposes.

A good example is a conversion from int32 to rune, which is how I discovered this. Those are aliases, but typically used to represent very different things. Honestly, I didn't even know that they were aliases, until I got those unconvert warnings.

Metadata

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