Skip to content

[3.8] [BUG] TLA top-level await breaks with parenthesis #36817

Description

@trusktr

TypeScript Version: 3.8.1-rc

Search Terms:

Code

// works:constDBService=awaitimport('./DBService')awaitDBService.start()// doesn't workawait(awaitimport('./DBService')).start()await(1+1)// works:asyncfunctionfoo(){await(awaitimport('./DBService')).start()}export{}

Expected behavior:

no error on the await word

Actual behavior:

TS thinks it is an identifier.

Playground Link:

Playground link

Related Issues:

#35276

Metadata

Metadata

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions