mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
insert type assertions when narrowing.
R=r OCL=24349 CL=24913
This commit is contained in:
parent
7cd24361bd
commit
49e2087848
17 changed files with 208 additions and 62 deletions
|
|
@ -105,9 +105,9 @@ func TypeToString(typ Type, expand bool) string {
|
|||
}
|
||||
return str + TypeToString(c.Elem(), false);
|
||||
case StructKind:
|
||||
return "struct{" + typeFieldsToString(typ, ";") + "}";
|
||||
return "struct{" + typeFieldsToString(typ.(StructType), ";") + "}";
|
||||
case InterfaceKind:
|
||||
return "interface{" + typeFieldsToString(typ, ";") + "}";
|
||||
return "interface{" + typeFieldsToString(typ.(InterfaceType), ";") + "}";
|
||||
case FuncKind:
|
||||
f := typ.(FuncType);
|
||||
str = "(" + typeFieldsToString(f.In(), ",") + ")";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue