-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
TypeScript Version: 2.9.0-dev.20180411
Search Terms: object spread unused property
Code
interface Point { x: number; y: number; }
function withX(p: Point, x: number): Point {
if (something) {
return { x, x: p.x, y: p.y }; // Error
} else {
return { x, ...p }; // No error
}
}Expected behavior:
Error at { x, ...p }: The first x is dead because ...p has its own non-optional x.
Actual behavior:
No error at { x, ...p }.
zpdDG4gta8XKpMCd
Metadata
Metadata
Assignees
Labels
Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Help WantedYou can do thisYou can do thisSuggestionAn idea for TypeScriptAn idea for TypeScript