Where a call through the method dispatches, as `Target::m` or `Target::m <- promotedInto @registeredAt`.
(graph: CodeGraph, method: Node)
| 261 | |
| 262 | /** Where a call through the method dispatches, as `Target::m` or `Target::m <- promotedInto @registeredAt`. */ |
| 263 | function dispatch(graph: CodeGraph, method: Node): string[] { |
| 264 | return graph |
| 265 | .getOutgoingEdgesFrom([method.id], ['calls']) |
| 266 | .filter((e) => meta(e).synthesizedBy === 'interface-impl') |
| 267 | .map((e) => { |
| 268 | const target = graph.getNode(e.target)?.qualifiedName; |
| 269 | const into = meta(e).promotedInto; |
| 270 | return into === undefined ? `${target}` : `${target} <- ${into} @${meta(e).registeredAt}`; |
| 271 | }) |
| 272 | .sort(); |
| 273 | } |
| 274 | |
| 275 | describe('a call through a Go interface reaches the method embedding promotes', () => { |
| 276 | it('links the interface method to the embedded type that declares it', () => { |
no test coverage detected