-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Bug Report
🔎 Search Terms
exactOptionalPropertyTypes
strictoptionalProperties
Partial
index signature dictionary record
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about
exactOptionalPropertyTypes
⏯ Playground Link
Playground link with relevant code
💻 Code
type MyRecord = { x: string; z: string };
const r: Partial<MyRecord> = {
x: "y",
// Error as expected ✅
z: undefined,
};
type MyDict = { [key: string]: string };
const d: Partial<MyDict> = {
x: "y",
// Expected error but got none ❌
z: undefined,
};
🙁 Actual behavior
See code comments above.
🙂 Expected behavior
See code comments above.
This was briefly discussed in #44524 and #44421 (comment).
jcalz, jsejcksn, tiagobento, CurtisFenner, ethanresnick and 13 more
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript