| 6546 | "node" in context ? contextNodeOf(context.parent) : context |
| 6547 | |
| 6548 | const hasInferType = (node: Node): boolean => { |
| 6549 | if (node.type === "TSInferType") return true |
| 6550 | for (const k of visitorKeys[node.type]) { |
| 6551 | const child = (node as never)[k] as Node | (Node | null)[] | null |
| 6552 | if (!child) continue |
| 6553 | if (Array.isArray(child)) { |
| 6554 | for (const item of child) if (item && hasInferType(item)) return true |
| 6555 | } else if (hasInferType(child)) return true |
| 6556 | } |
| 6557 | return false |
| 6558 | } |
| 6559 | |
| 6560 | const typeParameterOf = ( |
| 6561 | context: TypeContext | null | undefined, |