Duplicated type leads TSC to pick the wrong one in the *.d.ts file (for implicit return type) #25731
Labels
Design Limitation
Constraints of the existing architecture prevent this from being fixed
TypeScript Version: ^2.9.2 (also tested with @next with no difference)
Search Terms:
duplicated type, implicit return, type definition file
Code
Expected behavior:
Actual behavior:
Playground Link: Not a playground, but a repo (run
npm i && tsc
, although the output is in the repo anyway under thebuild/
directory): https://github.com/lorem--ipsum/tsc-testRelated Issues: -
Thoughts:
The file that gets its type definition is
component-b.tsx
. It needs to be compiled aftercomponent)-a.tsx
(I assume the order is alphabetical). The bug does happen when runningtsc --watch
, but only on the first run, not whencomponent-b.tsx
is changed. The returned type is correct when stated explicitly in the source file. It doesn't occur either when the two types (ComponentAPosition
andComponentBPosition
aren't strictly similar).The text was updated successfully, but these errors were encountered: