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

cmd/vet: "cannot import, possibly version skew" regression #25596

Closed
somersf opened this issue May 27, 2018 · 3 comments
Closed

cmd/vet: "cannot import, possibly version skew" regression #25596

somersf opened this issue May 27, 2018 · 3 comments

Comments

@somersf
Copy link
Contributor

@somersf somersf commented May 27, 2018

What version of Go are you using (go version)?

Tested using

$ go version
go version devel +c1d9d1f305 Sun May 27 07:33:08 2018 +0000 darwin/amd64

and

$ go version
go version go1.10.2 darwin/amd64

Does this issue reproduce with the latest release?

go1.10.2 and earlier releases do not fail the go vet check.

What operating system and processor architecture are you using (go env)?

Tested on:

  • GOOS=darwin GOARCH=amd64
  • GOOS=linux GOARCH=amd64

What did you do?

A recent change on master has caused go vet to report an error (..."cannot import, possibly version skew"...) on code that previously passed with go1.10.2, and go-devel versions until recently.

Multiple packages seem to be required - at least in the example I distilled:

Create $GOPATH/src/issue/a/a.go:

package a

type Entry interface {
        Writable() WritableEntry
}

type WritableEntry interface {
        Entry
}

Create $GOPATH/src/issue/b/b.go:

package b

import "issue/a"

var v a.Entry

Then run:

$ go vet issue/...

What did you expect to see?

go vet should not report any errors.

What did you see instead?

go vet reports:

# issue/b
b/b.go:3:8: could not import issue/a (cannot import, possibly version skew (embedded type is not an interface) - reinstall package)
vet: typecheck failures

Additional information

Bisecting the go project commits since this last passed with go-devel, indicates that the regression appeared with commit c730a93

Author: Robert Griesemer <redacted>
Date:   Wed May 23 16:35:56 2018 -0700

    go/types: permit embedding of non-defined interfaces via alias type names
@meirf

This comment has been minimized.

Copy link
Contributor

@meirf meirf commented May 27, 2018

(I am able to reproduce the vet error on darwin/amd64)

@griesemer

@agnivade agnivade changed the title go vet "cannot import, possibly version skew" regression cmd/vet: "cannot import, possibly version skew" regression May 28, 2018
@agnivade agnivade added this to the Go1.11 milestone May 28, 2018
@myitcv

This comment has been minimized.

Copy link
Member

@myitcv myitcv commented May 28, 2018

From a cursory glance, this looks to be because issue/a.Entry is not complete yet, i.e. it's Underlying() is nil. But I've not looked any further than that...

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented May 29, 2018

Change https://golang.org/cl/115155 mentions this issue: go/types: don't over-eagerly verify embedded interfaces

@agnivade agnivade added the NeedsFix label May 30, 2018
@gopherbot gopherbot closed this in fd4392b May 30, 2018
@golang golang locked and limited conversation to collaborators May 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.