}
s := sliceHeader{unsafe_NewArray(typ.Elem().(*rtype), cap), len, cap}
- return Value{typ.common(), unsafe.Pointer(&s), flagIndir | flag(Slice)}
+ return Value{typ.(*rtype), unsafe.Pointer(&s), flagIndir | flag(Slice)}
}
// MakeChan creates a new channel with the specified type and buffer size.
if typ.ChanDir() != BothDir {
panic("reflect.MakeChan: unidirectional channel type")
}
- ch := makechan(typ.(*rtype), buffer)
- return Value{typ.common(), ch, flag(Chan)}
+ t := typ.(*rtype)
+ ch := makechan(t, buffer)
+ return Value{t, ch, flag(Chan)}
}
// MakeMap creates a new map with the specified type.
if typ.Kind() != Map {
panic("reflect.MakeMapWithSize of non-map type")
}
- m := makemap(typ.(*rtype), n)
- return Value{typ.common(), m, flag(Map)}
+ t := typ.(*rtype)
+ m := makemap(t, n)
+ return Value{t, m, flag(Map)}
}
// Indirect returns the value that v points to.
if typ == nil {
panic("reflect: Zero(nil)")
}
- t := typ.common()
+ t := typ.(*rtype)
fl := flag(t.Kind())
if ifaceIndir(t) {
- return Value{t, unsafe_New(typ.(*rtype)), fl | flagIndir}
+ return Value{t, unsafe_New(t), fl | flagIndir}
}
return Value{t, nil, fl}
}
if typ == nil {
panic("reflect: New(nil)")
}
- ptr := unsafe_New(typ.(*rtype))
+ t := typ.(*rtype)
+ ptr := unsafe_New(t)
fl := flag(Ptr)
- return Value{typ.common().ptrTo(), ptr, fl}
+ return Value{t.ptrTo(), ptr, fl}
}
// NewAt returns a Value representing a pointer to a value of the
// specified type, using p as that pointer.
func NewAt(typ Type, p unsafe.Pointer) Value {
fl := flag(Ptr)
- return Value{typ.common().ptrTo(), p, fl}
+ t := typ.(*rtype)
+ return Value{t.ptrTo(), p, fl}
}
// assignTo returns a value v that can be assigned directly to typ.