You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tsc threw TS7022 error on the place that is not any type.
constgroup=awaitfetchGroup(nextId);// (id: string) => Promise<Group>// ^^^^^ 'group' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. (7022)
🔎 Search Terms
7022
#33191 and #39183 are maybe related. But in this case, the return type of fetchGroup() does not depend on parameters; that always Promise<Group> explicitly. Also, the type of nextId is always string at the line.
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about 7022
interfaceGroup{parentId: string|undefined//...}declarefunctionfetchGroup(id: string): Promise<Group>asyncfunctionfetchAncestorGroups(leafId: string): Promise<Group[]>{constgroups: Group[]=[];letnextId: string|undefined=leafId;while(nextId){constgroup=awaitfetchGroup(nextId);// ^^^^^ 'group' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. (7022)groups.push(group);nextId=group.parentId;}returngroups.reverse();}
🙁 Actual behavior
'group' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. (7022)
🙂 Expected behavior
No errors.
The text was updated successfully, but these errors were encountered:
This really is a circularity; the fact that we can higher-order-reason our way out of it doesn't make it not a circularity. The core checking algorithm doesn't have mechanisms in place that would allow this to be resolved.
Bug Report
Tsc threw TS7022 error on the place that is not
any
type.🔎 Search Terms
7022
#33191 and #39183 are maybe related. But in this case, the return type of
fetchGroup()
does not depend on parameters; that alwaysPromise<Group>
explicitly. Also, the type ofnextId
is alwaysstring
at the line.🕗 Version & Regression Information
(3.3.3 ... 4.2.0-dev.20210127)
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
🙂 Expected behavior
No errors.
The text was updated successfully, but these errors were encountered: