reflect: unnamed interface types have no name

Fixes #15468

Change-Id: I8723171f87774a98d5e80e7832ebb96dd1fbea74
Reviewed-on: https://go-review.googlesource.com/22524
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
David Crawshaw 2016-04-27 12:49:27 -04:00
parent 74a9bad638
commit 217be5b35d
3 changed files with 21 additions and 10 deletions

View file

@ -867,6 +867,9 @@ func (t *rtype) Name() string {
if hasPrefix(s, "func(") {
return ""
}
if hasPrefix(s, "interface {") {
return ""
}
switch s[0] {
case '[', '*', '<':
return ""