Skip to content

Intellisense/tsc: missed errors in union types #200

@mmkal

Description

@mmkal

The following seems like it passes when using tsc or in an IDE, when it (correctly) fails running tsd via CLI:

import { expectType } from 'tsd'

expectType<number | null>(1)

playground (strict mode enabled)

Given the docs say:

Asserts that the type of expression is identical to type T.

for expectType<T>(expression), this seems confusing. This behaves as expected in expect-type (playground)

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