Skip to content

ts2367 not implemented, unintentional comparison #222

@Uzlopak

Description

@Uzlopak

Currently implementing something for fastify, which can be simplified to:

const b: 'GET' | 'POST' = 'GET'

expectError(b === 1)
  534:4   Found an error that tsd does not currently support (ts2367), consider creating an issue on GitHub.                                                   
    534:16  This comparison appears to be unintentional because the types string | (string & Record<never, never>) | HTTPMethods[] and number have no overlap.

And yes I could do

expectAssignable<string>(b)

but it is less expressive imho

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions