-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
TypeScript Version: 3.8.3
Search Terms: [type inference], [partial], [record], [object spreading]
Code
type Point = {
x: number
y: number
}
type Space = Partial<Record<number, Point>>
function addPointReducer(point: Point, pointId: number, prevSpace: Space): Space {
const prevPoint = prevSpace[pointId]
return {
...prevPoint,
[pointId]: point,
}
}
Expected behavior:
Should throw an error on ...prevPoint
because Point
doesn't equal to Space
.
Actual behavior:
No error.
Related Issues:
sashashakun, wclr and tommykw
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.