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

go/types: incorrect type after failing import. #4962

Closed
robpike opened this issue Mar 1, 2013 · 1 comment
Closed

go/types: incorrect type after failing import. #4962

robpike opened this issue Mar 1, 2013 · 1 comment
Milestone

Comments

@robpike
Copy link
Contributor

robpike commented Mar 1, 2013

Reported by dsymonds about vet, but apparently a go/types issue.

package pkg

import (
        "fmt"
        "xpb" // not a standard package
)

func f() {
        var h xpb.SomeEnum
        fmt.Printf("%s", xpb.SomeEnum_name[int32(h)])
}

$ hg id
326a3ee842a2 tip
$ go tool vet -v x.go
vet: x.go:5:2: could not import xpb (can't find import: xpb)
Checking file x.go
x.go:10: arg xpb.SomeEnum_name[int32(h)] for printf verb %s of wrong type: uint8

I would expect the type reported here by go/types to be nil, but it's uint8. If it were
nil, vet wouldn't check it against the %s printf verb.
@griesemer
Copy link
Contributor

Comment 1:

This issue was closed by revision 83c8cc5.

Status changed to Fixed.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants