Skip to content

Type null is not assignable to type object with strictNullChecks #13438

@xLama

Description

@xLama

TypeScript Version: 2.2.0-dev20170112

Code

{
    "compilerOptions": {
        "strictNullChecks": true
    },
}
let foo : object = null

Expected behavior:

No error due to typeof null === "object"

Actual behavior:
Error. Type null is not assignable to type object

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions