mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
23 lines
594 B
TypeScript
23 lines
594 B
TypeScript
//// [tests/cases/compiler/genericFunctionsWithOptionalParameters1.ts] ////
|
|
|
|
//// [genericFunctionsWithOptionalParameters1.ts]
|
|
interface Utils {
|
|
fold<T, S>(c?: Array<T>, folder?: (s: S, t: T) => T, init?: S): T;
|
|
}
|
|
|
|
var utils: Utils;
|
|
|
|
utils.fold(); // no error
|
|
utils.fold(null); // no error
|
|
utils.fold(null, null); // no error
|
|
utils.fold(null, null, null); // no error
|
|
|
|
|
|
//// [genericFunctionsWithOptionalParameters1.js]
|
|
"use strict";
|
|
var utils;
|
|
utils.fold(); // no error
|
|
utils.fold(null); // no error
|
|
utils.fold(null, null); // no error
|
|
utils.fold(null, null, null); // no error
|