mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 22:55:36 -05:00
More tests:default-valued parameter+strictNullChecks
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
// @strictNullChecks: true
|
||||
function f(addUndefined1 = "J", addUndefined2?: number) {
|
||||
return addUndefined1.length + (addUndefined2 || 0);
|
||||
}
|
||||
function g(addUndefined = "J", addDefined: number) {
|
||||
return addUndefined.length + addDefined;
|
||||
}
|
||||
let total = f() + f('a', 1) + f('b') + f(undefined, 2);
|
||||
total = g('c', 3) + g(undefined, 4);
|
||||
|
||||
Reference in New Issue
Block a user