(root: BaseNode)
| 1923 | // in the order of `byId`, leaving out each union's cases, which hold nothing its |
| 1924 | // branches don't, so reading what's reached doesn't discriminate |
| 1925 | export const referencesWithoutCases = (root: BaseNode): Set<BaseNode> => { |
| 1926 | const references = new Set<BaseNode>() |
| 1927 | const include = (node: BaseNode): void => { |
| 1928 | if (references.has(node)) return |
| 1929 | references.add(node) |
| 1930 | for (let i = 0; i < node.children.length; i++) include(node.children[i]) |
| 1931 | if (node.is("union")) return |
| 1932 | for (const referenced of node.otherRefs) include(referenced) |
| 1933 | } |
| 1934 | include(root) |
| 1935 | return references |
| 1936 | } |
| 1937 | |
| 1938 | // resolves what referencesThroughAliases lists, in its order since any can throw, |
| 1939 | // without listing it for a Type that may never compile. what a node reaches |
no test coverage detected