Chris Tate and ejc3
009a01d074
Type empty arrays filled by later writes inside functions by their reads
...
An unannotated `const xs = []` (or `let`) inside a function, which
TypeScript types by the elements written before each read, takes the array
type its settled reads have: records pushed in a loop give a record array,
numbers a number[], strings a string[]. Reads inside closures, which the
checker leaves unsettled, do not count. When settled reads disagree or the
binding is reassigned, the binding is a dynamic array, as the same binding
already is at module scope. Before, such a binding was always number[] and
pushes of other values were refused.
Fixes #1623
Co-authored-by: ejc3 <1694850+ejc3@users.noreply.github.com >
2026-10-21 02:40:20 -05:00
..
2026-10-18 15:11:32 -07:00
2026-10-21 02:40:20 -05:00
2026-10-20 00:21:45 -05:00
2026-10-20 00:21:45 -05:00
2026-10-13 12:36:06 -05:00
2026-10-13 07:55:53 -05:00
2026-10-17 12:16:58 -07:00
2026-10-13 10:26:49 -05:00
2026-10-14 21:17:46 -05:00
2026-10-13 12:36:06 -05:00
2026-10-15 06:12:23 -07:00
2026-10-13 12:36:06 -05:00
2026-10-18 15:11:32 -07:00
2026-10-20 17:56:44 -05:00
2026-10-13 12:36:06 -05:00
2026-10-20 19:17:05 -05:00
2026-10-20 17:56:44 -05:00
2026-10-20 17:56:44 -05:00
2026-10-17 19:11:33 -05:00
2026-10-16 06:54:44 -07:00
2026-10-13 12:36:06 -05:00
2026-10-18 15:11:32 -07:00
2026-10-14 08:34:53 -05:00
2026-10-15 21:58:33 -05:00
2026-10-18 15:11:32 -07:00
2026-10-15 07:59:19 -05:00
2026-10-18 15:19:39 -07:00
2026-10-16 06:59:43 -07:00
2026-10-13 12:36:06 -05:00
2026-10-13 12:36:06 -05:00
2026-10-17 12:08:06 -07:00
2026-10-15 05:07:10 -07:00
2026-10-16 01:10:45 -05:00
2026-10-13 12:36:06 -05:00
2026-10-13 12:36:06 -05:00
2026-10-13 12:36:06 -05:00
2026-10-13 12:36:06 -05:00
2026-10-18 15:11:32 -07:00
2026-10-17 18:44:30 -05:00
2026-10-19 05:34:01 -07:00
2026-10-20 16:42:01 -07:00
2026-10-17 11:10:43 -07:00
2026-10-16 04:45:45 -05:00
2026-10-18 15:11:32 -07:00
2026-10-17 12:28:03 -07:00
2026-10-18 15:11:32 -07:00
2026-10-20 17:56:44 -05:00
2026-10-19 07:55:06 -05:00
2026-10-13 12:36:06 -05:00
2026-10-12 23:05:43 -05:00
2026-10-18 07:31:43 -07:00
2026-10-18 07:31:43 -07:00
2026-10-20 17:56:44 -05:00
2026-10-20 17:56:44 -05:00
2026-10-20 00:21:45 -05:00
2026-10-16 10:10:02 -05:00
2026-10-21 01:08:13 -05:00
2026-10-14 21:09:51 -05:00
2026-10-20 01:21:06 -07:00
2026-10-14 09:58:18 -05:00
2026-10-16 20:13:00 -05:00
2026-10-16 05:12:23 -05:00
2026-10-13 20:30:01 -05:00
2026-10-17 16:00:54 -05:00
2026-10-15 13:39:03 -05:00
2026-10-20 17:56:44 -05:00
2026-10-13 20:26:38 -05:00
2026-10-18 15:11:32 -07:00
2026-10-13 12:36:06 -05:00
2026-10-13 21:24:38 -05:00
2026-10-16 14:02:02 -07:00
2026-10-17 13:32:48 -07:00
2026-10-13 12:36:06 -05:00
2026-10-13 12:36:06 -05:00
2026-10-20 11:00:03 -05:00
2026-10-19 23:38:15 -05:00
2026-10-13 18:51:09 -05:00
2026-10-18 15:19:39 -07:00
2026-10-18 15:19:39 -07:00
2026-10-14 21:28:04 -05:00