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.57k stars 574 forks source link

Incorrect resolving for package level defined variables #2700

Open dlsniper opened 8 years ago

dlsniper commented 8 years ago

I've noticed while working on: https://github.com/go-lang-plugin-org/go-lang-idea-plugin/pull/2699 that the following code is resolving incorrectly:

package main

import "fmt"

var fmt, _ = fmt.Println("demo")

func main() {
    fmt.Println("demo") // fmt here resolves to the import not to the variable declaration at the package level
}

Commit hash: 9c3f29b775846912e9f4ac35e084e8b371dba7cf

grenki commented 7 years ago

@dlsniper It isn't possible to define package level variable same named as import alias image