guardedFunctionOp creates an invocation guard around the provided variadic function binding, if one is provided.
(funcName string, disableTypeGuards bool)
| 781 | |
| 782 | // guardedFunctionOp creates an invocation guard around the provided variadic function binding, if one is provided. |
| 783 | func (o *OverloadDecl) guardedFunctionOp(funcName string, disableTypeGuards bool) functions.FunctionOp { |
| 784 | if o.functionOp == nil { |
| 785 | return nil |
| 786 | } |
| 787 | return func(args ...ref.Val) ref.Val { |
| 788 | if !o.matchesRuntimeSignature(disableTypeGuards, args...) { |
| 789 | return MaybeNoSuchOverload(funcName, args...) |
| 790 | } |
| 791 | return o.functionOp(args...) |
| 792 | } |
| 793 | } |
| 794 | |
| 795 | // matchesRuntimeUnarySignature indicates whether the argument type is runtime assiganble to the overload's expected argument. |
| 796 | func (o *OverloadDecl) matchesRuntimeUnarySignature(disableTypeGuards bool, arg ref.Val) bool { |
no test coverage detected