lookupFunction returns a Decl proto for typeName as a function in env. Returns nil if no such function is found in env.
(name string)
| 236 | // lookupFunction returns a Decl proto for typeName as a function in env. |
| 237 | // Returns nil if no such function is found in env. |
| 238 | func (e *Env) lookupFunction(name string) *decls.FunctionDecl { |
| 239 | for _, candidate := range e.container.ResolveCandidateNames(name) { |
| 240 | if fn := e.declarations.FindFunction(candidate); fn != nil { |
| 241 | return fn |
| 242 | } |
| 243 | } |
| 244 | return nil |
| 245 | } |
| 246 | |
| 247 | // setFunction adds the function Decl to the Env. |
| 248 | // Adds a function decl if one doesn't already exist, then adds all overloads from the Decl. |
no test coverage detected