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

Don't warn for type aliases #61

Open
jdemeyer opened this issue Apr 26, 2023 · 0 comments
Open

Don't warn for type aliases #61

jdemeyer opened this issue Apr 26, 2023 · 0 comments

Comments

@jdemeyer
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant