mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
42 lines
907 B
Plaintext
42 lines
907 B
Plaintext
//// [tests/cases/compiler/contravariantOnlyInferenceWithAnnotatedOptionalParameterJs.ts] ////
|
|
|
|
=== index.js ===
|
|
/**
|
|
* @template T
|
|
* @param {(value: T, index: number) => boolean} predicate
|
|
* @returns {T}
|
|
*/
|
|
function filter(predicate) {
|
|
>filter : Symbol(filter, Decl(index.js, 0, 0))
|
|
>predicate : Symbol(predicate, Decl(index.js, 5, 16))
|
|
|
|
return /** @type {any} */ (null);
|
|
}
|
|
|
|
const a = filter(
|
|
>a : Symbol(a, Decl(index.js, 9, 5))
|
|
>filter : Symbol(filter, Decl(index.js, 0, 0))
|
|
|
|
/**
|
|
* @param {number} [pose]
|
|
*/
|
|
(pose) => true
|
|
>pose : Symbol(pose, Decl(index.js, 13, 3))
|
|
|
|
);
|
|
|
|
const b = filter(
|
|
>b : Symbol(b, Decl(index.js, 16, 5))
|
|
>filter : Symbol(filter, Decl(index.js, 0, 0))
|
|
|
|
/**
|
|
* @param {number} [pose]
|
|
* @param {number} [_]
|
|
*/
|
|
(pose, _) => true
|
|
>pose : Symbol(pose, Decl(index.js, 21, 3))
|
|
>_ : Symbol(_, Decl(index.js, 21, 8))
|
|
|
|
);
|
|
|