Skip to content

go/types: incorrect "no such field/method" error in cyclic interface #18395

Closed
@alandonovan

Description

@alandonovan

The following excerpt minimized from a real program causes go/types to emit a spurious error:

$ cat a.go
package base

type A interface {
        B
}

type B interface {
        C
}

type C interface {
        D
        F() A
}

type D interface {
        G() B
}

var _ = A(nil).G // error: no such field or method
$ ssadump a.go
a.go:20:9: invalid operation: A(nil) (value of type A) has no field or method G
ssadump: couldn't load packages due to errors: base

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.early-in-cycleA change that should be done early in the 3 month dev cycle.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions