-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Help WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
Description
π Search Terms
recursive any noImplicitAny d.ts
π Version & Regression Information
- This is the behavior in every version I tried (3.3 through 5.2), and I reviewed the FAQ for entries about anything related to this.
β― Playground Link
π» Code
const a = () => a;
π Actual behavior
Any is implicitly introduced in the d.ts:
declare const a: () => any;
Note that the local type checking (not using the d.ts) correctly handles this recursive type without introducing "any", and builds fine with noImplicitAny enabled.
π Expected behavior
Either generate something without implicitly introducing any
, or generate an error if noImplicitAny
is enabled.
In this case, the below code generation for the d.ts would work:
declare const a: () => typeof a;
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Help WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases