Skip to content

go/types: named types defined within a function print as if defined at package scope #5501

@adonovan

Description

@adonovan
package main
type T int
func f() {
        type T int
}

Both of these types are printed as "main.T".  This is ambiguous and confusing;
the f-local type should have a different name.  Not sure what 6g does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions