Closed
Description
Filing an issue to track the regression from #26143 described in #26143 (comment).
TypeScript Version: master (fe387cc)
Search Terms: narrow assignment weak type assignable comparable
Code
type AOrArrA<T> = T | T[];
const arr: AOrArrA<{x?: "ok"}> = [{ x: "ok" }]; // weak type
arr.push({ x: "ok" }); // Error: Property 'push' does not exist on type 'AOrArrA<{ x?: "ok"; }>'.
Expected behavior: No error.
Actual behavior: Error as indicated above.
Playground Link: N/A, playground is not affected
Related Issues: #26143