(id: string)
| 1141 | // The type and every type it embeds, down to the last level. Go allows a |
| 1142 | // struct to embed a pointer to itself, or to one embedding it back. |
| 1143 | const embedClosure = (id: string): string[] => { |
| 1144 | if (embeds(id).length === 0) return [id]; |
| 1145 | const reached = new Set<string>([id]); |
| 1146 | const pending = [id]; |
| 1147 | while (pending.length > 0) { |
| 1148 | const at = pending.pop()!; |
| 1149 | for (const t of embeds(at)) { |
| 1150 | if (reached.has(t)) continue; |
| 1151 | reached.add(t); |
| 1152 | pending.push(t); |
| 1153 | } |
| 1154 | } |
| 1155 | return [...reached]; |
| 1156 | }; |
| 1157 | |
| 1158 | // The types each one embeds from outside the index, as the resolver's failed |
| 1159 | // `extends` rows: the methods of a standard-library type or of `error`, by |
no test coverage detected