-
Notifications
You must be signed in to change notification settings - Fork 27
Don't warn for type aliases #61
Copy link
Copy link
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels