// @strict: true interface Box { v: T; } interface ErrorResult { readonly error: true } interface AsyncLoaderProps { readonly asyncLoad: () => Box; readonly children: (result: Exclude) => string; } class AsyncLoader { constructor(props: string, context: any); constructor(props: AsyncLoaderProps); constructor(...args: any[]) {} } function load(): Box<{ success: true } | ErrorResult> { return null as any; } new AsyncLoader({ asyncLoad: load, children: result => result.success as any, }); // should work fine