compiler,reflect: sort out pkg path vs pkg name for named types

This commit is contained in:
Damian Gryski
2023-03-13 14:49:51 -07:00
committed by Ron Evans
parent f2cc98caa5
commit 876f08979f
4 changed files with 31 additions and 11 deletions
+5
View File
@@ -243,6 +243,11 @@ func TestNamedTypes(t *testing.T) {
t.Errorf("TypeOf.String()=%v, want %v", got, want)
}
errorType := TypeOf((*error)(nil)).Elem()
if s := errorType.String(); s != "error" {
t.Errorf("error type = %v, want error", s)
}
m := make(map[[4]uint16]string)
if got, want := TypeOf(m).String(), "map[[4]uint16]string"; got != want {