Skip to content

go/ast,go/parser: Decl field of type parameter identifier is nil for methods (but not for functions) #50956

@aarzilli

Description

@aarzilli
$ go version
go version devel go1.18-902dc38212 Tue Feb 1 16:52:46 2022 +0000 linux/amd64

See: https://gotipplay.golang.org/p/QhA7oB1-h54
For F, a generic funciton, the identifier T has a Decl field referring to the field in the type parameter list of F.
But for M, a method for a generic type, the identifier T` has a nil Decl field instead.

Is this intentional? Seems inconsistent.

cc @findleyr

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions