// @flow

class C<T> {
  x: T;
}

declare function fn<T>(x: C<T>): C<T['foo']>;

declare const c: C<{foo: {bar: any, ...}, ...}>;
const x = fn(c);

x as C<{bar: unknown, ...}>;
x as C<{bar: empty, ...}>;
