microsoft / microsoft/TypeScript
API: incorrect declarations in types.ts
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
The --strictNullChecks PR changed some declarations in types.ts to avoid frequent assertions in the compiler's code. Unfortunately these changes make it really unsafe for API users because they no longer contain the actually nullable types: https://github.com/Microsoft/TypeScript/pull/22088#discussion_r184149465 https://github.com/Microsoft/TypeScript/pull/22088#discussion_r184155027
ts.Node#parentis no longer optional (which is definitely wrong forSourceFile)ts.Symbol#declarationsandts.Symbol.valueDeclarationare no longer optional, but can still be undefinedts.Type#symbolis no longer optional, but I guess this comment is still up to date:// Symbol associated with type (if any)
These changes should either be reverted or replaced in the published declaration files.
/cc @andy-ms @weswigham
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the declarations in types.ts and review the linked discussions about the strictNullChecks changes. Check the published declaration files for ts.Node#parent, ts.Symbol#declarations, ts.Symbol.valueDeclaration, and ts.Type#symbol. Done means these declarations accurately allow the nullable or absent values described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100