go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 570 forks source link

Incorrect automatic refactoring for boolean expressions #2837

Open groz opened 7 years ago

groz commented 7 years ago

func (my My) cmp(other My) bool { return (my.x == nil && other.x != nil) || (my.x != nil && other.x == nil) }


- What would you expect to happen?
No refactoring tips or a simple tip to remove brackets.

- What happens?
Intellij proposes automatic refactoring to:
```go
func (my *My) cmp(other *My) bool {
    return my.x != nil && other.x == nil
}

This suggestion also pops up for all other similar boolean cases.