Skip to content

go/types: "invalid AST" error for syntactically correct (but otherwise invalid) program #25301

Closed
@griesemer

Description

@griesemer

x.go:

package p

type T = interface {
	m() interface{ T }
}

gotype x.go produces

$ gotype x.go
x.go:4:17: invalid AST: T is not a named type
x.go:4:17: invalid AST: T is not a named type

For reference:
cmd.compile:

x.go:3:6: invalid recursive type alias T
	x.go:3:6: T uses <T>
	x.go:3:10: <T> uses <T>
	x.go:4:3: <T> uses <T>
	x.go:4:6: <T> uses T

gccgo accepts this code w/o error.

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