-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Description
Bug Report
Simple interface doesn't extends Record<string, unknown>
We can't use extends object
because it's for any JS object, it's not good
🔎 Search Terms
Interface extends Record unknown
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries
⏯ Playground Link
💻 Code
type MoveType = { x: number, y: number }
interface MoveInterface { x: number, y: number }
const isXY = (a: Record<string, unknown>): a is { x: number, y: number } => {
return true
}
let t: MoveType = { x: 0, y: 0 }
let i: MoveInterface = { x: 0, y: 0 }
isXY(t)
isXY(i)
🙁 Actual behavior
We can use isXY for the type
, not for the interface
🙂 Expected behavior
Can use isXY(i)
Metadata
Metadata
Assignees
Labels
No labels