Skip to content

keyof never should be never #33025

Closed
Closed
@AnyhowStep

Description

@AnyhowStep

TypeScript Version: 3.5.1

Search Terms:

keyof never

Code

//Expected: type k = never
//Actual  : type k = string | number | symbol
type k = keyof never

Expected behavior:

keyof never should be never

Actual behavior:

keyof never is string|number|symbol

Intuitively, to me, if no values inhabit never, then the set of keys is the empty set (also never).

Playground Link:

Playground

Related Issues:

Searching "keyof never" brought up 400+ total results, so...

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