Skip to content

go/types, types2: type-checker internal type printing doesn't print embedded fields that are alias types correctly #44410

@griesemer

Description

@griesemer

Given

type E = map[string]int
type S struct {
   E
}

the struct S will be printed with an embedded field named map[string]int because we have lost information about its alias name.

This affects debugging and test cases, e.g., src/go/internal/gccgoimporter/importer_test.go:97 wants "type S struct{b int; A2" but we only have "type S struct{b int; map[Y]Z}".

The relevant printing code is in go/types/typestring.go, function writeType.

Metadata

Metadata

Assignees

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