I'm really struggling with this seemingly simple problem and it's frustrating. I would appreciate any insights or different perspectives on what might be causing the issue.
const objA: {foo:string} = { foo:'bar' };
const objB: {foo:string} = { foo: 'bar'};
fn([
[objA, (val) => {}],
// ^^^^ type is corrent.
// ^^^ expect type to be {foo:string} (same as position 1), but got `unknown`
[objB, (val) => {}],
// IBID
]);
declare function fn<
Ax,
Bx,
A extends entry_T<Ax>,
B extends entry_T<Bx>,
>(args: [A, B?]): void;
type entry_T<X> = [X, (val: X) => void];