foo2 = async (t, a) => {
  const { baz } = await a;
  t.is(baz, 42);

  const bP = E(a).bar(); // bP is a promise for a string
  t.is(Promise.resolve(bP), bP);
  t.is(await bP, 'barRet');

  // @ts-expect-error - awaiting remotes cannot get functions
  (await a).bar;

  // Can obtain a far function.
  const ff = (await a).far;

  // @ts-expect-error - far functions cannot be called without E
  ff();

  // Can call the far function.
  const ffP = E(ff)();
  t.is(Promise.resolve(ffP), ffP);
  t.is(await ffP, 'hello');

  const bazP = E.get(a).baz; // bazP is a promise for a number
  t.is(Promise.resolve(bazP), bazP);
  t.is(await bazP, 42);

  // @ts-expect-error - E.get cannot obtain remote functions
  const barP = E.get(a).bar;
  t.is(Promise.resolve(barP), barP);
  t.is(typeof (await barP), 'function');

  t.is((await a).baz, 42);

  // @ts-expect-error - calling a directly is not typed, but works.
  a.bar();
}
Check the correctness of FarRef<T>.

@param {import('ava').ExecutionContext<unknown>} t
@param {import('@endo/eventual-send').FarRef<
 { bar(): string },
 { far: import('@endo/eventual-send').FarRef<() => 'hello'>,
   baz: number,
 }>} a