.getChildSyntaxList() unexpectedly returns undefined for UnionTypeNode
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
Version: 20.0.0
The `.getChildSyntaxList()` method on UnionTypeNode does not work - it returns undefined even though UnionTypeNode has a direct SyntaxList child node:

**To Reproduce**
```ts
import { Project } from "ts-morph";
const project = new Project();
const sourceFile = project.createSourceFile("test.ts", `
const a: string | undefined;
`);
const unionTypeNode = sourceFile.getVariableDeclaration('a').getTypeNode();
unionTypeNode.getChildSyntaxList(); // undefined
```
**Expected behavior**
Child syntax list should be returned
Contributor guide
Research direction
Read CONTRIBUTING.md, then start at UnionTypeNode.getChildSyntaxList() and reproduce the behavior with the TypeScript snippet in the issue. Done means the call returns the direct child SyntaxList for the union type instead of undefined, with the reproduction confirming the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100