Skip to content

Exclude is bottlenecked by depth limit #53583

Closed
@ufukbakan

Description

@ufukbakan

When excluding a type from an unlimited type , it should calculate excluded type first but it doesnt. For example:

type NonZ = Exclude<string, 'Z'>;
const myval: NonZ = 'Z'; // doesnt give any error

Because of this bug many other bugs happens like :

interface HasNotZ {
  [key: NonZ]: number
}

const MyObj : HasNotZ = {
  Z: 123 // is still valid .... Should give an error
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions