-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
SpecIssues related to the TypeScript language specificationIssues related to the TypeScript language specification
Description
Code
Try the following out at https://www.typescriptlang.org/play/index.html (sadly, this is too long to include a sharable link)
let num1: 1;
let num2: 2;
let num3: typeof num2;
num3 = num2;
num3 = num1;
Expected behavior:
This works exactly as expected, such that there's an error on the second assignment to num3.
I don't easily see something in your doc that mentions this is possible. It is probably implicit in various places, as it is particularly useful with some unions. Seems like calling this out explicitly would be valuable?
Metadata
Metadata
Assignees
Labels
SpecIssues related to the TypeScript language specificationIssues related to the TypeScript language specification