Files
tsgo/testdata/baselines/reference/submodule/compiler/arrayIterationLibES5TargetDifferent(nolib=false,target=esnext).errors.txt
2026-02-11 19:19:37 +00:00

32 lines
951 B
Plaintext

arrayIterationLibES5TargetDifferent.ts(15,17): error TS2495: Type 'number' is not an array type or a string type.
arrayIterationLibES5TargetDifferent.ts(21,17): error TS2495: Type '{ foo: string; }' is not an array type or a string type.
==== arrayIterationLibES5TargetDifferent.ts (2 errors) ====
declare function log(message?: any): void;
for (const x of [1, 2, 3]) {
log(x);
}
declare const aString: string;
for (const x of aString) {
log(x);
}
declare const aNumber: number;
for (const x of aNumber) {
~~~~~~~
!!! error TS2495: Type 'number' is not an array type or a string type.
log(x);
}
declare const anObject: { foo: string };
for (const x of anObject) {
~~~~~~~~
!!! error TS2495: Type '{ foo: string; }' is not an array type or a string type.
log(x);
}