-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 3.3.0-dev
Code
function test<T extends { a: string, b: string }>(obj: T): T {
let { a, ...rest } = obj;
return { a: 'hello', ...rest } as T; // Error, but shouldn't be
}
Expected behavior:
No errors.
Actual behavior:
Error as shown above.
Playground Link:
Related Issues:
Found while investigating #28884.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue