Skip to content

strictNullChecks and arithmetic expressions #12795

@bobappleyard

Description

@bobappleyard

TypeScript Version: 2.1.4

With strictNullChecks on:

Code

    let y = undefined + 1;

Expected behavior:

An error telling me this is the wrong thing to do.

Actual behavior:

Compiles fine, y is a number.

This does the same thing for all the arithmetic operators.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions