Malte Ubl
93765cd6a2
Pass enclosing-frame values to generic arrow instances as trailing parameters
...
A generic arrow or function-expression binding declared inside a function
used to be refused (SC1090) whenever its body read anything from the
enclosing frame, because its monomorphized instances are module functions
with no closure.
Give each instance the frame it needs: every value the binding reads from
the enclosing function becomes a TRAILING parameter of the instance, and
every call site (which sits in the declaring frame or in a closure over it)
passes the current value after the declared arguments. The instance body
binds the same symbol, so it resolves the reference like any parameter.
Sound only while the original binding never changes, so the fence now
covers exactly what a copy cannot stand in for: `this`, `super`,
`new.target`, `arguments`, an enclosing type parameter, an enclosing
generic scope (per-instantiation types), and any binding with a write
anywhere in the file or declared after the binding (temporal dead zone).
Corpus: withClientIdentity/withIdentity, physicalModels (captured Set),
listTwo (captured local function), runTracked (async, call from a nested
closure) and twice (two instances, different capture values). The
generic-value-bindings diagnostics fixture now pins the fences that remain
(a capture the file reassigns, and an enclosing generic scope) instead of
the never-reassigned parameter it used to.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com >
(cherry picked from commit 5b23e6ccf110c66e96fad472265d7b53db0f342a)
2026-10-28 19:49:28 -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-22 18:49:52 -07: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-10-28 09:37:13 -07: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-28 19:49:28 -07: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-07-22 18:08:04 -05:00
2026-07-23 02:42:10 -05:00
2026-10-28 08:56:20 -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-10-28 14:57:21 -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