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
Expected behavior: No error, page type inferred specifically.
Actual behavior: 'page' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.(7022)
This is a circularity because the return type of getPage could depend on the type of its parameter, so the loop creates a circularity: getPage(cursor) depends on cursor's possible values which depends on the type of page.cursor which depends on the type of getPage(cursor)
TypeScript Version: 'Nightly' in playground
Search Terms: stateful loop inference any
Code
Expected behavior: No error,
page
type inferred specifically.Actual behavior: 'page' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.(7022)
Playground Link: https://www.typescriptlang.org/play/?ts=4.0.0-dev.20200620#code/IYZwngdgxgBAZgV2gFwJYHsIwOYFNkAKweAFFAgE4joUBcMIyFqE2MAPjBAgDY8CUMAN4AoGDAr5KWUePGSQvZCHoAeRs1YBtALoA+XQBoxc8lRr0z1CjADUMAOQB9B8fEBfANwj3IkaEhYRBQMLAAHYhZgZFwSQVkYHnwYKwsGJhY2Tm4+GABeLl4ebxMAdwALVCSYEiYEXHiTcShMRhgIvHyYYFLgVGQcfCJSVIp+bzkUymsujtwAOlGJmF9fIA
Is this unexpected, or a known limitation?
The text was updated successfully, but these errors were encountered: