Browse Source

reflect: implement a number of stub functions

These stub functions are necessary for the encoding/json package. They
don't seem to be called in trivial cases, so leave them as simple stubs
for now.
pull/1606/head
Ayke van Laethem 5 years ago
committed by Ron Evans
parent
commit
9f3dcf3733
  1. 20
      src/reflect/value.go

20
src/reflect/value.go

@ -539,6 +539,14 @@ func maskAndShift(value, offset, size uintptr) uintptr {
return (uintptr(value) >> (offset * 8)) & mask
}
func (v Value) NumMethod() int {
return v.typecode.NumMethod()
}
func (v Value) OverflowFloat(x float64) bool {
panic("unimplemented: (reflect.Value).OverflowFloat()")
}
func (v Value) MapKeys() []Value {
panic("unimplemented: (reflect.Value).MapKeys()")
}
@ -662,6 +670,18 @@ func (v Value) SetString(x string) {
}
}
func (v Value) SetBytes(x []byte) {
panic("unimplemented: (reflect.Value).SetBytes()")
}
func (v Value) SetCap(n int) {
panic("unimplemented: (reflect.Value).SetCap()")
}
func (v Value) SetLen(n int) {
panic("unimplemented: (reflect.Value).SetLen()")
}
func (v Value) checkAddressable() {
if !v.isIndirect() {
panic("reflect: value is not addressable")

Loading…
Cancel
Save