summaryrefslogtreecommitdiff
path: root/src/lib/reflect/value.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/reflect/value.go')
-rw-r--r--src/lib/reflect/value.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/reflect/value.go b/src/lib/reflect/value.go
index af43de98a..354880347 100644
--- a/src/lib/reflect/value.go
+++ b/src/lib/reflect/value.go
@@ -776,12 +776,17 @@ func interfaceCreator(typ Type, addr Addr) Value {
// Its implementation is incomplete.
type FuncValue interface {
Value;
+ Get() Addr; // The address of the function.
}
type funcValueStruct struct {
commonValue
}
+func (v *funcValueStruct) Get() Addr {
+ return *(*Addr)(v.addr)
+}
+
func funcCreator(typ Type, addr Addr) Value {
return &funcValueStruct{ commonValue{FuncKind, typ, addr} }
}
@@ -827,8 +832,6 @@ func newValueAddr(typ Type, addr Addr) Value {
func NewInitValue(typ Type) Value {
// Some values cannot be made this way.
switch typ.Kind() {
- case FuncKind: // must be pointers, at least for now (TODO?)
- return nil;
case ArrayKind:
if typ.(ArrayType).IsSlice() {
return nil