handle the nil interface better in reflect and print

R=rsc
DELTA=25  (19 added, 0 deleted, 6 changed)
OCL=20985
CL=20985
This commit is contained in:
Rob Pike 2008-12-11 12:59:49 -08:00
parent 793a6effcf
commit ac09eb4f49
3 changed files with 25 additions and 6 deletions

View file

@ -59,6 +59,7 @@ type Creator *(typ Type, addr Addr) Value
export type MissingValue interface {
Kind() int;
Type() Type;
Addr() Addr;
}
type MissingValueStruct struct {
@ -66,7 +67,7 @@ type MissingValueStruct struct {
}
func MissingCreator(typ Type, addr Addr) Value {
return &MissingValueStruct{ Common{IntKind, typ, addr} }
return &MissingValueStruct{ Common{MissingKind, typ, addr} }
}
// -- Int