-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
Bug Report
🔎 Search Terms
- function
- record
- any
- mapped type
🕗 Version & Regression Information
I see the bug in all the versions of TypeScript, from v3.3.3 to v5.0.2, and even in the Nightly version.
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about mapped types.
⏯ Playground Link
Playground link with relevant code
💻 Code
const x: Record<string, any> = () => {};🙁 Actual behavior
I do not get any type error.
🙂 Expected behavior
I expected to get the following type error.
Type '() => void' is not assignable to type 'Record<string, any>'.
Index signature for type 'string' is missing in type '() => void'.
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug