Skip to content

TS7022 circularity regression in 5.4.2Β #57705

@jfirebaugh

Description

@jfirebaugh

πŸ”Ž Search Terms

TS7022 circularity

πŸ•— Version & Regression Information

  • This changed between versions 5.3.3 and 5.4.2

⏯ Playground Link

πŸ’» Code

declare function is<T>(v: T): v is T;
const o: Record<string, string> | undefined = {};
if (o) {
  for (const key in o) {
    const value = o[key];
    if (is<string>(value)) {
    }
  }
}

πŸ™ Actual behavior

TS7022: value implicitly has type any because it does not have a type annotation and is referenced directly or indirectly in its own initializer.

πŸ™‚ Expected behavior

No error, like in 5.3.3.

Additional information about the issue

No response

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions