mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
More tests:default-valued parameter+strictNullChecks
This commit is contained in:
1 parent
bb9b6819b3
commit
96c14de26a
1 file changed
+6
@@ -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