Skip to content

Unexpected circularly references error in VSCodeΒ #50795

Closed
@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

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions