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:
James Shubin
2025-04-27 22:23:42 -04:00
parent fb6eae184a
commit 47aecd25c3

View File

@@ -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,
} }
} }