Skip to content

Function extends Record<string, any> but not Record<string, unknown> #41746

@jo32

Description

@jo32

TypeScript Version: 4.1.2

Search Terms:
extends unknown

Code

type A = (() => true) extends Record<string, any> ? true : false; // true
type B = (() => true) extends Record<string, unknown> ? true : false; // false

Expected behavior:
type A and type B should be the same

Actual behavior:
not the same

Playground Link:
https://www.typescriptlang.org/play?#code/C4TwDgpgBAglC8UAUSCUCB8VgCcCuE6EAHsBAHYAmAzlAEoQDGA9jpQDzW4CW5A5gBooAQ3IgsAfmz5oALigAzYQBtqEANxQA9FukEAUKEhQAQgmRpMewlBJkqtBizace-IXnIBrcswDu5JLWUPJKqhraumFqQA

Related Issues:
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions