microsoft / microsoft/TypeScript
Conflicting function return types checked for single bindings, but not overloads.
Open
Nobody has claimed this yet.
In Discussion
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 3.1.1-insiders.20180926 (what's running in the playground)
Search Terms: conflicting function return
Code
declare var foo: () => number
declare var foo: () => string
declare function bar(): number
declare function bar(): string
Expected behavior: foo and bar to both fail
Actual behavior: bar seems to still type-check, inconsistently with foo
Related Issues: N/A
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 by reproducing the two declaration examples in the linked TypeScript Playground and compare how single bindings and overloaded function declarations are checked. Trace the compiler entry point that validates conflicting return types; done means both foo and bar produce the expected error consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100