Skip to content

Unexpected circularly references error in VSCode #50795

@whzx5byb

Description

@whzx5byb

Bug Report

🔎 Search Terms

🕗 Version & Regression Information

  • This changed between versions 4.6.4 and 4.7.3

⏯ Playground Link

cannot reproduce in playground

💻 Code

function fn(Foo: number) {
    type Foo = typeof Foo;

    return 0 as any as {x: Foo};
}

🙁 Actual behavior

In vscode with TS version > 4.6.4 it reports 'Foo' is referenced directly or indirectly in its own type annotation.ts(2502). But it works well in the playground.

This is first reported by @TechQuery in #50792 (comment), and I realize it may be related to #50161 and #50191 since the behavior is quite similar.

🙂 Expected behavior

No error.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestone

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions