New in 3.2.2(?) is this type mistake in baz() below. result should be destructured to having type string, but instead it is any even though the unabbreviated syntaxes work correctly.
type responseType = { result: string }
declare function post<T = responseType>(): Promise<T>;
async function foo() {
const response = await post(); // response : responseType OK
const result = response.result; // result : string OK
}
async function bar() {
const response = await post(); // response : responseType OK
const { result } = response; // result : string OK
}
async function baz() {
const { result } = await post(); // result : any !!!!!!!!!!!
}
New in 3.2.2(?) is this type mistake in
baz()below.resultshould be destructured to having type string, but instead it isanyeven though the unabbreviated syntaxes work correctly.