TypeScript/tests/cases/compiler/evolvingArrayTypeInAssert.ts
Anders Hejlsberg 7798f532df
Fix crash caused by assertion with evolving array type (#38398)
* Properly finalize evolving array type in getTypeAtFlowCall

* Add regression test
2020-05-07 14:05:57 -07:00

11 lines
200 B
TypeScript

// @strict: true
export function unsafeCast<T>(_value: unknown): asserts _value is T { }
function yadda() {
let out = [];
out.push(100)
unsafeCast<any>(out);
return out;
}