当我试图解构以下函数的返回类型时: const coreml = async (): Promise<{label: string; confidenceconfidence} = await coreml(/*path to image*/); 我得到了 'confidence' is assigned a value but never used.eslint@typescript-eslint
} 然后像这样调用这个函数: function bar() { if (a === undefined) { }
return a; // TypeScript infers a as number (good!)} 因为函数foo返回元组(number, undefined)或(undefined, number),所以在没