-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.An issue that has been verified to require only test changes, not just a test failure.
Milestone
Description
Reproducer:
package main
import (
"fmt"
"go/ast"
"go/importer"
"go/parser"
"go/token"
"go/types"
)
func main() {
fmt.Println(run())
}
const src = `package main
import . "net/http"
type Request struct{}
`
func run() error {
fset := token.NewFileSet()
f, err := parser.ParseFile(fset, "test.go", src, parser.SkipObjectResolution)
if err != nil {
return err
}
cfg := types.Config{
Importer: importer.Default(),
Error: func(err error) {
e := err.(types.Error)
fmt.Println(e.Msg, e.Pos, e.Fset.Position(e.Pos))
},
}
cfg.Check("test", fset, []*ast.File{f}, nil)
return nil
}
$ go run .
Request already declared through dot-import of package http ("net/http") 41 test.go:5:6
other declaration of Request 2883740 -
"net/http" imported and not used 22 test.go:3:8
<nil>
Note the second error other declaration of Request 2883740 -
, which tries to reference the file in the net/http
package.
Metadata
Metadata
Assignees
Labels
FixPendingIssues that have a fix which has not yet been reviewed or submitted.Issues that have a fix which has not yet been reviewed or submitted.NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.An issue that has been verified to require only test changes, not just a test failure.