Skip to content

error TS2531: Object is possibly 'null' when using | operator (strictNullChecks are off) #14380

Closed
@sweko

Description

@sweko

I'm getting errors compiling after an update to 2.2.1.
The tsconfig.json file does not specify strictNullChecks, and the problem persists even when strictNullChecks are explicitly set to false.

TypeScript Version: 2.2.1

Code

console.log( 3 | null);

Expected behavior:
Successful compilation
Actual behavior:
error TS2531: Object is possibly 'null'

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