mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Fix crash caused by assertion with evolving array type (#38398)
* Properly finalize evolving array type in getTypeAtFlowCall * Add regression test
This commit is contained in:
10
tests/cases/compiler/evolvingArrayTypeInAssert.ts
Normal file
10
tests/cases/compiler/evolvingArrayTypeInAssert.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// @strict: true
|
||||
|
||||
export function unsafeCast<T>(_value: unknown): asserts _value is T { }
|
||||
|
||||
function yadda() {
|
||||
let out = [];
|
||||
out.push(100)
|
||||
unsafeCast<any>(out);
|
||||
return out;
|
||||
}
|
||||
Reference in New Issue
Block a user