mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
55 lines
2.8 KiB
Plaintext
55 lines
2.8 KiB
Plaintext
assignmentIndexedToPrimitives.ts(1,7): error TS2322: Type 'number[]' is not assignable to type 'number'.
|
|
assignmentIndexedToPrimitives.ts(2,7): error TS2322: Type 'string[]' is not assignable to type 'number'.
|
|
assignmentIndexedToPrimitives.ts(3,7): error TS2322: Type '(string | number)[]' is not assignable to type 'number'.
|
|
assignmentIndexedToPrimitives.ts(4,7): error TS2322: Type 'number[]' is not assignable to type '0'.
|
|
assignmentIndexedToPrimitives.ts(6,7): error TS2322: Type 'number[]' is not assignable to type 'string'.
|
|
assignmentIndexedToPrimitives.ts(7,7): error TS2322: Type 'string[]' is not assignable to type 'string'.
|
|
assignmentIndexedToPrimitives.ts(8,7): error TS2322: Type '(string | number)[]' is not assignable to type 'string'.
|
|
assignmentIndexedToPrimitives.ts(9,7): error TS2322: Type 'string[]' is not assignable to type '"01"'.
|
|
assignmentIndexedToPrimitives.ts(11,7): error TS2322: Type '{ 0: number; }' is not assignable to type 'number'.
|
|
assignmentIndexedToPrimitives.ts(13,7): error TS2322: Type '{ 0: number; }' is not assignable to type 'string'.
|
|
assignmentIndexedToPrimitives.ts(14,7): error TS2322: Type '{ "0": number; }' is not assignable to type 'string'.
|
|
assignmentIndexedToPrimitives.ts(15,7): error TS2322: Type '{ 0: string; }' is not assignable to type 'string'.
|
|
|
|
|
|
==== assignmentIndexedToPrimitives.ts (12 errors) ====
|
|
const n1: number = [0];
|
|
~~
|
|
!!! error TS2322: Type 'number[]' is not assignable to type 'number'.
|
|
const n2: number = ["0"];
|
|
~~
|
|
!!! error TS2322: Type 'string[]' is not assignable to type 'number'.
|
|
const n3: number = [0, "1"];
|
|
~~
|
|
!!! error TS2322: Type '(string | number)[]' is not assignable to type 'number'.
|
|
const n4: 0 = [0];
|
|
~~
|
|
!!! error TS2322: Type 'number[]' is not assignable to type '0'.
|
|
|
|
const s1: string = [0];
|
|
~~
|
|
!!! error TS2322: Type 'number[]' is not assignable to type 'string'.
|
|
const s2: string = ["0"];
|
|
~~
|
|
!!! error TS2322: Type 'string[]' is not assignable to type 'string'.
|
|
const s3: string = [0, "1"];
|
|
~~
|
|
!!! error TS2322: Type '(string | number)[]' is not assignable to type 'string'.
|
|
const s4: "01" = ["0", "1"];
|
|
~~
|
|
!!! error TS2322: Type 'string[]' is not assignable to type '"01"'.
|
|
|
|
const no1: number = { 0: 1 };
|
|
~~~
|
|
!!! error TS2322: Type '{ 0: number; }' is not assignable to type 'number'.
|
|
|
|
const so1: string = { 0: 1 };
|
|
~~~
|
|
!!! error TS2322: Type '{ 0: number; }' is not assignable to type 'string'.
|
|
const so2: string = { "0": 1 };
|
|
~~~
|
|
!!! error TS2322: Type '{ "0": number; }' is not assignable to type 'string'.
|
|
const so3: string = { 0: "1" };
|
|
~~~
|
|
!!! error TS2322: Type '{ 0: string; }' is not assignable to type 'string'.
|
|
|