lang: funcs: structs: Pass through the type
Not sure why this wasn't done or if it should be, but seems plausible for now.
This commit is contained in:
@@ -53,8 +53,13 @@ func FuncValueToConstFunc(fv *full.FuncValue) interfaces.Func {
|
|||||||
// SimpleFnToDirectFunc transforms a name and *types.FuncValue into an
|
// SimpleFnToDirectFunc transforms a name and *types.FuncValue into an
|
||||||
// interfaces.Func which is implemented by &simple.WrappedFunc{}.
|
// interfaces.Func which is implemented by &simple.WrappedFunc{}.
|
||||||
func SimpleFnToDirectFunc(name string, fv *types.FuncValue) interfaces.Func {
|
func SimpleFnToDirectFunc(name string, fv *types.FuncValue) interfaces.Func {
|
||||||
|
var typ *types.Type
|
||||||
|
if fv != nil { // TODO: is this necessary?
|
||||||
|
typ = fv.T
|
||||||
|
}
|
||||||
return &wrapped.Func{
|
return &wrapped.Func{
|
||||||
Name: name,
|
Name: name,
|
||||||
|
Type: typ, // TODO: is this needed?
|
||||||
Fn: fv,
|
Fn: fv,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user