Skip to content

go/types: rejects valid program involving interfaces and cycles #21804

@dominikh

Description

@dominikh

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

go version devel +6b6b9f69fd Wed Aug 9 05:33:09 2017 +0000 linux/amd64
go version go1.9 linux/amd64
go version go1.8.3 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

https://play.golang.org/p/Vne0Zww-Qf

What did you expect to see?

package gps ("qps") <nil>

What did you see instead?

package gps ("qps") main.go:37:20: cannot use UnpairedVersion(nil) (value of type UnpairedVersion) as Constraint value in variable declaration: missing method copyTo

The Go compiler accepts this code. The example is based on a (much, much larger) real code base (golang/dep#1127)

/cc @griesemer

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions