2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/genericFunctionsWithOptionalParameters1.ts ===
|
|
|
|
interface Utils {
|
|
|
|
>Utils : Utils
|
|
|
|
|
|
|
|
fold<T, S>(c?: Array<T>, folder?: (s: S, t: T) => T, init?: S): T;
|
|
|
|
>fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
>T : T
|
|
|
|
>S : S
|
|
|
|
>c : T[]
|
2014-08-19 04:56:03 +02:00
|
|
|
>Array : T[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
>folder : (s: S, t: T) => T
|
|
|
|
>s : S
|
|
|
|
>S : S
|
|
|
|
>t : T
|
|
|
|
>T : T
|
|
|
|
>T : T
|
|
|
|
>init : S
|
|
|
|
>S : S
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
|
|
|
|
var utils: Utils;
|
|
|
|
>utils : Utils
|
|
|
|
>Utils : Utils
|
|
|
|
|
|
|
|
utils.fold(); // no error
|
|
|
|
>utils.fold() : {}
|
|
|
|
>utils.fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
>utils : Utils
|
|
|
|
>fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
|
|
|
|
utils.fold(null); // no error
|
|
|
|
>utils.fold(null) : {}
|
|
|
|
>utils.fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
>utils : Utils
|
|
|
|
>fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
|
|
|
|
utils.fold(null, null); // no error
|
|
|
|
>utils.fold(null, null) : {}
|
|
|
|
>utils.fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
>utils : Utils
|
|
|
|
>fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
|
|
|
|
utils.fold(null, null, null); // no error
|
|
|
|
>utils.fold(null, null, null) : {}
|
|
|
|
>utils.fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
>utils : Utils
|
|
|
|
>fold : <T, S>(c?: T[], folder?: (s: S, t: T) => T, init?: S) => T
|
|
|
|
|