Skip to content

False positive for TS2448 "use before declaration" in 3.8.3 --target esnext #37287

Closed
@Jessidhia

Description

@Jessidhia

TypeScript Version: 3.8.3

Search Terms:
TS2448, use before declaration

Code

const a = () => b()
const b = () => null
a()

Expected behavior:
No errors

Actual behavior:

Block-scoped variable 'b' used before its declaration.

Playground Link: Playground Link


This error seems to only happen, at least in the playground, when the target is set to ESNext. If it's set to, say, ES2020, the error goes away... in tsservice; it still happens in tsc.

This seems to have been introduced between 3.8.0-beta (builds) and 3.8.1-rc (errors).

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions