Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

void does not accept null if strictNullChecks is enabled #468

Closed
@gdh1995

Description

@gdh1995

Updated: I find a void variable can not be assigned to null null can not be assigned to a void variable if I enable strictNullChecks on lastest TypeScript nodejs package.

But in https://github.com/Microsoft/TypeScript-Handbook/blob/master/pages/Basic%20Types.md#L207, it says:

However, when using the --strictNullChecks flag, null and undefined are only assignable to void and their respective types.

Is there any mistake made by me or the document?

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