Typescript 4.2

Announcing TypeScript 4.2

Announcing TypeScript 4.2

Announcing TypeScript 4.2 Beta

Announcing TypeScript 4.2 Beta

let foo: [...string[], number];

foo = [123];
foo = ["hello", 123];
foo = ["hello!", "hello!", "hello!", 123];

let bar: [boolean, ...string[], boolean];

bar = [true, false];
bar = [true, "some text", false];
bar = [true, "some", "separated", "text", false];
const n: number = 123;

// Has the type `${number}px`
const s1 = `${n}px`;

// Works!
const s2: `${number}px` = s1;

// Error!
const s3: `${number}pt` = s1;

// Has the type 'string' because of widening.
let v1 = s1;

업데이트: