insert type assertions when narrowing.

R=r
OCL=24349
CL=24913
This commit is contained in:
Russ Cox 2009-02-11 17:55:16 -08:00
parent 7cd24361bd
commit 49e2087848
17 changed files with 208 additions and 62 deletions

View file

@ -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(), ",") + ")";