mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
1dc4b6dc61
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
32 lines
951 B
Plaintext
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);
|
|
} |