Malte Ubl and Claude Opus 5.5
a0a6910e4e
Destructure union sources by narrowing first and joining arm reads
...
An object pattern over a union whose arms type a field differently, or do
not declare it at all, was refused with SC1031, even though the pattern
element's own type is the checker's answer: the join of the arms' declared
types, with undefined for an arm that omits the key, or the narrowed arm
when a discriminant test or an `in` guard refined the source at the
pattern's site.
Keep the unionDisc fast path wherever every arm declares the field with
one type, so programs that compile today emit identical IR. Otherwise read
through the existing keyed join (unionKeyGet): each arm answers its
declared type and a record arm that does not declare the key answers
undefined, which is exactly the desugar's own property read. Only
destructuring passes the new missingFieldAsUndefined flag, so dotted reads
keep their current refusals.
Narrow first when the un-narrowed pattern does not fit: bind the
checker-narrowed view of the source to a hidden local — a trusting
arm extraction for one arm, a sub-union re-tag whose excluded arms trap,
and the stored layout view for an intersection refinement — and lower the
pattern over that view.
A rest element over a union source packs each arm's unconsumed fields into
a fresh record of the checker's arm-wise rest type, selected by the
runtime tag; CopyDataProperties makes a fresh object too, so nothing
aliases the source. Shapes that do not spell the rest type still fence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com >
2026-10-28 05:37:58 -07:00
..
2026-07-22 18:08:04 -05:00
2026-10-20 17:56:44 -05:00
2026-09-15 21:17:31 -05:00
2026-10-18 06:24:04 -07:00
2026-09-14 09:19:08 -05:00
2026-10-17 19:58:21 -07:00
2026-10-17 19:58:21 -07:00
2026-10-08 11:29:07 -05:00
2026-10-08 11:29:07 -05:00
2026-10-08 11:29:07 -05:00
2026-10-08 11:29:07 -05:00
2026-10-17 15:47:37 -05:00
2026-10-18 17:30:54 -07:00
2026-07-22 18:08:04 -05:00
2026-08-08 11:35:01 -05:00
2026-10-20 18:40:37 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00
2026-08-08 11:35:01 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00
2026-10-20 17:56:44 -05:00
2026-10-22 04:27:35 -05:00
2026-10-22 04:27:35 -05:00
2026-10-22 04:27:35 -05:00
2026-10-17 16:06:08 -05:00
2026-09-20 15:59:34 -05:00
2026-07-22 18:08:04 -05:00
2026-10-12 12:25:30 -05:00
2026-07-23 00:40:54 -05:00
2026-10-23 17:15:33 -05:00
2026-10-23 19:05:58 -05:00
2026-08-08 11:35:01 -05:00
2026-08-08 11:35:01 -05:00
2026-10-07 13:55:11 -05:00
2026-10-13 19:12:53 -05:00
2026-10-23 15:13:03 -05:00
2026-10-01 17:36:29 -05:00
2026-10-22 10:09:08 -05:00
2026-10-23 23:31:58 -05:00
2026-10-25 13:26:27 -05:00
2026-10-20 17:56:44 -05:00
2026-10-15 22:01:38 -05:00
2026-10-24 08:07:52 -05:00
2026-09-15 00:03:07 -05:00
2026-10-05 09:32:14 -05:00
2026-09-28 22:20:24 -05:00
2026-10-20 17:56:44 -05:00
2026-10-20 17:56:44 -05:00
2026-10-19 04:48:10 -05:00
2026-10-20 17:56:44 -05:00
2026-10-08 01:21:43 -05:00
2026-10-17 18:44:30 -05:00
2026-10-03 07:40:13 -05:00
2026-10-20 17:56:44 -05:00
2026-10-22 20:33:33 -05:00
2026-07-22 18:08:04 -05:00
2026-10-20 17:56:44 -05:00
2026-09-28 08:12:06 -05:00
2026-09-30 17:53:59 -05:00
2026-10-19 04:48:10 -05:00
2026-10-19 07:55:06 -05:00
2026-09-27 11:41:52 -05:00
2026-10-22 20:33:09 -05:00
2026-10-20 17:56:44 -05:00
2026-10-13 18:55:55 -05:00
2026-10-18 14:42:18 -07:00
2026-10-18 14:42:18 -07:00
2026-10-11 16:30:25 -07:00
2026-10-11 16:30:24 -07:00
2026-10-12 02:33:29 -05:00
2026-10-17 12:08:06 -07:00
2026-10-17 12:08:06 -07:00
2026-10-23 09:25:07 -05:00
2026-10-24 17:35:51 -05:00
2026-10-11 16:30:24 -07:00
2026-10-11 12:24:27 -07:00
2026-10-17 12:08:06 -07:00
2026-10-11 16:30:23 -07:00
2026-10-12 09:38:24 -05:00
2026-09-20 14:44:19 -05:00
2026-10-17 22:45:32 -05:00
2026-10-19 00:47:00 -05:00
2026-07-22 18:08:04 -05:00
2026-07-22 18:08:04 -05:00
2026-07-23 00:37:25 -05:00
2026-07-22 18:08:04 -05:00
2026-10-28 05:37:58 -07:00
2026-09-20 15:59:34 -05:00
2026-10-01 17:36:29 -05:00
2026-10-18 15:55:12 -07:00
2026-09-23 00:38:45 -05:00
2026-09-23 00:38:45 -05:00
2026-09-23 00:38:45 -05:00
2026-09-23 00:38:45 -05:00
2026-07-24 09:37:57 -05:00
2026-07-22 18:08:04 -05:00
2026-10-22 06:52:18 -05:00
2026-10-18 07:07:37 -07:00
2026-10-20 12:55:55 -05:00
2026-10-20 12:55:55 -05:00
2026-10-20 12:55:55 -05:00
2026-10-19 07:55:06 -05:00
2026-10-14 17:18:04 -05:00
2026-10-20 17:56:44 -05:00
2026-09-13 23:34:17 -05:00
2026-10-01 17:36:29 -05:00
2026-08-17 10:34:43 -04:00
2026-08-14 10:27:38 -04:00
2026-08-14 10:27:38 -04:00
2026-08-14 10:27:38 -04:00
2026-10-20 18:11:57 -05:00
2026-10-23 16:27:40 -05:00
2026-09-19 21:49:21 -05:00
2026-07-22 18:08:04 -05:00
2026-10-22 18:17:48 -05:00
2026-09-27 23:33:40 -05:00
2026-10-17 18:36:45 -05:00
2026-07-23 16:55:31 -05:00
2026-10-22 02:56:39 -05:00
2026-10-07 11:47:54 -05:00
2026-10-23 16:23:37 -05:00
2026-07-22 18:08:04 -05:00
2026-09-23 10:21:53 -05:00
2026-10-05 09:32:14 -05:00
2026-07-22 18:08:04 -05:00
2026-09-02 18:18:09 -05:00
2026-10-04 01:03:02 -05:00
2026-10-04 01:03:02 -05:00
2026-10-04 01:03:02 -05:00
2026-09-02 18:18:09 -05:00
2026-07-22 18:08:04 -05:00
2026-10-23 12:54:17 -05:00
2026-10-20 17:56:44 -05:00
2026-10-20 17:56:44 -05:00
2026-10-20 17:56:44 -05:00
2026-10-08 01:21:43 -05:00
2026-10-23 00:54:10 -05:00
2026-10-15 19:59:56 -05:00
2026-09-14 13:46:36 -05:00
2026-10-24 12:01:26 -05:00
2026-07-23 20:30:47 -05:00
2026-10-22 16:00:41 -07:00
2026-10-22 19:54:17 -05:00
2026-07-22 18:08:04 -05:00
2026-10-18 18:34:09 -05:00
2026-10-17 15:47:37 -05:00
2026-10-22 06:44:59 -05:00
2026-10-20 17:56:44 -05:00
2026-10-18 12:05:25 -07:00
2026-10-18 08:32:52 -07:00
2026-08-08 11:35:01 -05:00
2026-10-02 13:26:27 -05:00
2026-10-18 15:58:57 -07:00
2026-10-24 23:35:56 -05:00
2026-07-24 11:38:39 -05:00
2026-07-22 18:08:04 -05:00
2026-07-23 17:20:03 -05:00
2026-10-20 17:56:44 -05:00
2026-10-17 20:55:17 -05:00
2026-10-20 17:56:44 -05:00
2026-09-14 18:15:44 -05:00
2026-07-23 01:05:22 -05:00
2026-07-22 18:08:04 -05:00
2026-10-19 20:55:04 -07:00
2026-07-22 18:08:04 -05:00
2026-10-22 21:47:37 -05:00
2026-10-22 17:43:09 -07:00
2026-10-22 17:43:09 -07:00
2026-10-22 21:18:48 -05:00
2026-10-22 17:43:09 -07:00
2026-10-03 20:16:24 -05:00
2026-10-23 18:11:49 -05:00
2026-10-09 07:49:53 -05:00
2026-10-20 17:56:44 -05:00
2026-10-20 17:56:44 -05:00
2026-09-12 22:39:07 -05:00
2026-10-15 22:53:40 -05:00
2026-07-24 11:14:58 -05:00
2026-09-18 22:50:45 -05:00
2026-10-18 14:40:40 -07:00
2026-10-20 12:25:57 -05:00
2026-09-14 00:38:06 -05:00
2026-10-20 17:56:44 -05:00
2026-10-26 01:50:59 -05:00
2026-07-24 11:14:58 -05:00
2026-10-18 03:37:40 -05:00
2026-10-18 07:07:44 -07:00
2026-10-18 03:37:40 -05:00
2026-09-28 22:20:24 -05:00
2026-10-12 12:25:30 -05:00
2026-10-12 12:25:30 -05:00
2026-10-12 12:25:30 -05:00
2026-10-12 12:25:30 -05:00
2026-10-12 12:25:30 -05:00
2026-10-12 12:25:30 -05:00
2026-10-12 12:25:30 -05:00
2026-10-12 12:25:30 -05:00
2026-10-12 12:25:30 -05:00
2026-10-19 04:48:10 -05:00
2026-10-09 00:23:28 -05:00
2026-10-09 22:05:36 -05:00
2026-07-22 18:08:04 -05:00
2026-10-05 09:32:14 -05:00
2026-10-18 05:31:40 -05:00
2026-10-18 11:47:04 -07:00
2026-09-19 00:00:26 -05:00
2026-10-09 10:33:07 -05:00
2026-07-22 18:08:04 -05:00
2026-07-23 02:42:10 -05:00
2026-10-23 22:08:02 -05:00
2026-09-29 20:58:04 -05:00
2026-10-22 08:35:56 -05:00
2026-10-20 17:56:44 -05:00
2026-10-23 07:50:09 -05:00
2026-10-18 17:57:35 -07:00
2026-10-17 03:28:15 -05:00
2026-10-01 17:36:29 -05:00
2026-08-09 23:15:51 -05:00
2026-10-20 17:56:44 -05:00
2026-10-21 21:56:08 -05:00
2026-10-22 04:52:44 -05:00
2026-08-08 11:35:01 -05:00
2026-09-28 19:48:46 -05:00
2026-10-21 02:28:56 -05:00
2026-07-23 00:40:54 -05:00
2026-09-28 23:49:13 -05:00
2026-10-23 17:34:59 -05:00
2026-10-09 00:23:28 -05:00
2026-10-26 01:50:59 -05:00
2026-10-04 01:57:10 -05:00
2026-10-04 01:57:10 -05:00
2026-10-04 01:57:10 -05:00
2026-10-22 20:33:09 -05:00
2026-10-20 17:56:44 -05:00
2026-10-20 17:56:44 -05:00
2026-10-22 03:33:29 -05:00
2026-10-23 18:01:19 -05:00
2026-10-18 09:52:17 -05:00