TypeScript/tests/cases/compiler/strictNullLogicalAndOr.ts
Yui 5f91b3cf40 [Transforms] merging "master" on 06/15/2016 (#9218)
* Add upper limit for the program size, fix readDirectory for the symlink files

* Add comments

* CR feedback / Change upper limit / Add disableSizeLimit compiler option

* online and offline CR feedback

* Don't count current opened client file if it's TS file

* Speed up file searching

* Make language service optional for a project

* Fix failed tests

* Fix project updateing issue after editing config file

* Fix merging issues and multiple project scenario

* Refactoring

* add test and spit commandLineParser changes to another PR

* Fix #8523

* check the declaration and use order if both are not in module file

* Fix #9098: report missing function impelementation errors for merged classes and namespaces

* Added tests.

* Accepted baselines.

* Check tuple types when getting the type node's type.

* Accepted baselines.

* Fix #9173: clear out lib and types before creating a program in transpileModule

* Added tests.

* Accepted baselines.

* Always check type assertion types.

* Accepted baselines.

* Use helper functions to simplify range tests

* Remove String, Number, and Boolean from TypeFlags.Falsy

* Add regression test

* Accept new baselines

* Allow property declarations in .js files

* Remove old test

* Refactor code to make if statements cheaper

* Fix test failure from mergining with master
2016-06-17 16:40:26 -07:00

15 lines
260 B
TypeScript

// @strictNullChecks: true
// Repro from #9113
let sinOrCos = Math.random() < .5;
let choice = sinOrCos && Math.sin || Math.cos;
choice(Math.PI);
function sq(n?: number): number {
const r = n !== undefined && n*n || 0;
return r;
}
sq(3);