lang: Functions that build should be copyable
It's not entirely clear if this is required, but it's probably a good idea. We should consider making it a requirement of the BuildableFunc interface.
This commit is contained in:
@@ -354,6 +354,16 @@ func (obj *PrintfFunc) Stream(ctx context.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Copy is implemented so that the obj.Type value is not lost if we copy this
|
||||
// function.
|
||||
func (obj *PrintfFunc) Copy() interfaces.Func {
|
||||
return &PrintfFunc{
|
||||
Type: obj.Type, // don't copy because we use this after unification
|
||||
|
||||
init: obj.init, // likely gets overwritten anyways
|
||||
}
|
||||
}
|
||||
|
||||
// Call this function with the input args and return the value if it is possible
|
||||
// to do so at this time.
|
||||
func (obj *PrintfFunc) Call(ctx context.Context, args []types.Value) (types.Value, error) {
|
||||
|
||||
Reference in New Issue
Block a user