Skip to content

TS2495: Type 'Readonly<any[]>' is not an array type or a string type #12377

@falsandtru

Description

@falsandtru

TypeScript Version: master

Code

for (const _ of Object.freeze([])) {}

Expected behavior:

pass

Actual behavior:

$ node built/local/tsc.js -t es5 --lib es6 index.ts
index.ts(1,17): error TS2495: Type 'Readonly<any[]>' is not an array type or a string type.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions