mlugg
d11bbde5f9
compiler: remove anonymous struct types, unify all tuples
...
This commit reworks how anonymous struct literals and tuples work.
Previously, an untyped anonymous struct literal
(e.g. `const x = .{ .a = 123 }`) was given an "anonymous struct type",
which is a special kind of struct which coerces using structural
equivalence. This mechanism was a holdover from before we used
RLS / result types as the primary mechanism of type inference. This
commit changes the language so that the type assigned here is a "normal"
struct type. It uses a form of equivalence based on the AST node and the
type's structure, much like a reified (`@Type`) type.
Additionally, tuples have been simplified. The distinction between
"simple" and "complex" tuple types is eliminated. All tuples, even those
explicitly declared using `struct { ... }` syntax, use structural
equivalence, and do not undergo staged type resolution. Tuples are very
restricted: they cannot have non-`auto` layouts, cannot have aligned
fields, and cannot have default values with the exception of `comptime`
fields. Tuples currently do not have optimized layout, but this can be
changed in the future.
This change simplifies the language, and fixes some problematic
coercions through pointers which led to unintuitive behavior.
Resolves : #16865
2024-10-31 20:42:53 +00:00
..
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-08-28 08:39:59 +01:00
2023-10-17 20:05:55 +00:00
2023-12-11 12:24:15 -07:00
2023-08-22 13:54:14 -07:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 00:12:43 +02:00
2024-01-16 16:27:31 -08:00
2024-01-16 16:27:31 -08:00
2024-01-16 16:27:31 -08:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-09-23 22:01:08 +01:00
2024-10-31 20:42:53 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-30 13:15:40 +02:00
2024-10-19 19:15:23 +01:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-08 06:56:52 +00:00
2024-01-12 16:23:42 -08:00
2024-10-19 19:15:23 +01:00
2023-11-19 09:56:51 +00:00
2024-04-18 04:45:14 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-03-11 07:09:10 -07:00
2024-03-11 07:09:10 -07:00
2024-03-11 07:09:10 -07:00
2024-03-11 07:09:10 -07:00
2024-03-11 07:09:10 -07:00
2024-03-11 07:09:10 -07:00
2024-07-12 00:43:38 -07:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-04-17 13:41:25 +01:00
2024-08-28 08:39:59 +01:00
2024-04-17 13:41:25 +01:00
2023-11-19 09:56:51 +00:00
2024-04-17 13:41:25 +01:00
2023-11-19 09:56:51 +00:00
2024-10-19 19:15:23 +01:00
2023-11-18 12:03:10 +00:00
2024-10-31 20:42:53 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-10-22 18:46:14 -04:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-07-21 00:03:23 -07:00
2023-09-19 15:15:05 +03:00
2024-10-19 19:46:07 +01:00
2024-10-19 19:46:07 +01:00
2024-10-19 19:46:07 +01:00
2024-10-19 19:46:07 +01:00
2024-09-10 01:45:48 +03:00
2024-01-16 18:22:44 +02:00
2024-01-16 18:22:44 +02:00
2024-01-16 18:22:44 +02:00
2024-05-11 02:17:24 -07:00
2023-11-19 09:56:51 +00:00
2024-09-01 17:34:07 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-09-23 22:01:08 +01:00
2023-09-23 22:01:08 +01:00
2023-09-15 11:33:53 -07:00
2023-11-19 09:56:51 +00:00
2024-10-19 19:15:23 +01:00
2024-10-31 20:42:53 +00:00
2024-07-16 16:42:13 +00:00
2024-07-16 16:42:13 +00:00
2024-08-29 23:43:52 +01:00
2023-11-19 09:56:51 +00:00
2024-09-16 17:11:47 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-04-17 13:41:25 +01:00
2024-07-13 04:47:38 -04:00
2023-11-19 09:56:51 +00:00
2024-09-01 17:31:00 +03:00
2023-11-19 09:56:51 +00:00
2024-07-04 21:01:41 +01:00
2024-09-01 17:34:07 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-03-14 07:40:05 +00:00
2024-01-22 18:08:56 -08:00
2023-11-19 09:56:51 +00:00
2023-09-19 15:15:05 +03:00
2023-11-19 09:56:51 +00:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2024-10-07 07:27:50 +01:00
2024-10-07 07:42:17 +01:00
2023-11-19 09:56:51 +00:00
2023-09-19 15:15:05 +03:00
2023-11-19 09:56:51 +00:00
2024-08-29 23:43:52 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-08-28 08:39:59 +01:00
2024-04-17 13:41:25 +01:00
2024-10-31 20:42:53 +00:00
2024-07-04 21:01:42 +01:00
2024-07-15 10:58:33 +03:00
2024-07-21 01:55:52 -07:00
2024-05-14 01:13:49 +09:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-08-29 23:43:52 +01:00
2024-01-20 17:23:47 +00:00
2024-01-20 17:23:47 +00:00
2024-01-20 17:23:47 +00:00
2024-08-29 23:43:52 +01:00
2024-08-29 23:43:52 +01:00
2024-09-01 18:31:01 +01:00
2024-07-31 16:57:42 -07:00
2023-11-19 09:56:51 +00:00
2024-01-29 01:43:19 +02:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-06-15 00:57:52 +01:00
2023-11-19 00:12:43 +02:00
2024-01-22 18:08:56 -08:00
2024-08-29 23:43:52 +01:00
2023-09-19 15:15:05 +03:00
2024-01-16 05:55:26 +01:00
2024-09-12 23:46:00 +01:00
2024-08-28 08:39:59 +01:00
2024-03-28 15:24:01 +02:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-05-22 02:16:56 +09:00
2023-09-19 15:15:05 +03:00
2023-11-19 09:56:51 +00:00
2024-10-27 18:02:12 +01:00
2023-11-19 09:56:51 +00:00
2024-10-19 19:15:23 +01:00
2024-10-19 19:15:23 +01:00
2024-08-27 00:44:35 +01:00
2024-08-27 00:44:35 +01:00
2024-10-19 19:15:23 +01:00
2024-10-19 19:15:23 +01:00
2024-01-06 16:49:41 -08:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-09-15 11:33:53 -07:00
2023-11-19 09:56:51 +00:00
2024-08-29 23:43:52 +01:00
2024-03-30 20:50:48 -04:00
2024-03-30 20:50:48 -04:00
2024-03-30 20:50:48 -04:00
2024-03-30 20:50:48 -04:00
2024-03-30 20:50:48 -04:00
2024-03-30 20:50:48 -04:00
2023-09-19 15:15:05 +03:00
2024-10-31 20:42:53 +00:00
2023-10-13 03:43:54 -07:00
2023-09-23 22:01:08 +01:00
2024-05-14 01:13:48 +09:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2024-10-20 09:21:14 +02:00
2024-04-17 13:41:25 +01:00
2024-03-17 03:06:17 +01:00
2023-09-19 15:15:05 +03:00
2024-10-19 19:15:23 +01:00
2024-10-19 19:15:23 +01:00
2024-10-19 19:15:23 +01:00
2024-10-19 19:15:23 +01:00
2024-08-28 08:39:59 +01:00
2024-05-14 01:13:48 +09:00
2023-11-19 09:56:51 +00:00
2024-08-28 08:39:59 +01:00
2024-10-28 02:24:59 +00:00
2024-05-14 01:13:48 +09:00
2024-05-14 01:13:48 +09:00
2024-05-14 01:13:48 +09:00
2024-05-14 01:13:49 +09:00
2024-05-14 01:13:48 +09:00
2024-05-14 01:13:49 +09:00
2024-05-14 01:13:48 +09:00
2024-05-14 01:13:48 +09:00
2024-02-12 12:54:32 -08:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-10-27 18:02:12 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-10-08 20:58:04 -07:00
2023-10-08 20:58:04 -07:00
2023-10-08 20:58:04 -07:00
2023-11-19 09:56:51 +00:00
2024-07-21 01:55:52 -07:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-03-30 20:50:48 -04:00
2023-11-19 09:56:51 +00:00
2024-07-04 21:01:42 +01:00
2023-11-19 09:56:51 +00:00
2024-07-04 21:01:42 +01:00
2024-07-04 21:01:42 +01:00
2024-02-12 12:54:32 -08:00
2023-11-19 09:56:51 +00:00
2024-10-27 18:02:12 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-07-21 00:10:36 -07:00
2023-09-19 15:15:05 +03:00
2024-03-30 20:50:48 -04:00
2024-08-27 00:44:35 +01:00
2023-08-12 01:57:11 -04:00
2023-08-12 01:57:15 -04:00
2023-11-19 09:56:51 +00:00
2023-09-19 15:15:05 +03:00
2024-07-04 21:01:42 +01:00
2024-02-12 12:54:32 -08:00
2023-09-15 11:33:53 -07:00
2023-09-15 11:33:53 -07:00
2024-08-29 23:43:52 +01:00
2024-10-19 19:15:23 +01:00
2023-11-21 13:59:14 +02:00
2024-10-18 08:50:40 +01:00
2023-11-19 09:56:51 +00:00
2024-10-19 19:46:07 +01:00
2024-03-17 03:06:17 +01:00
2024-02-12 12:54:32 -08:00
2023-11-19 09:56:51 +00:00
2024-07-31 16:57:42 -07:00
2024-02-12 12:54:32 -08:00
2023-11-19 09:56:51 +00:00
2024-07-03 02:53:37 -04:00
2024-10-31 20:42:53 +00:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-29 23:43:52 +01:00
2023-11-19 09:56:51 +00:00
2023-08-12 02:22:26 -04:00
2024-10-19 19:15:23 +01:00
2024-07-21 23:56:04 +00:00
2023-10-16 01:30:39 +00:00
2024-07-31 16:57:42 -07:00
2024-10-19 19:15:23 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-07-21 01:55:52 -07:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2024-04-17 13:41:25 +01:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-08-28 08:39:59 +01:00
2024-10-03 12:28:44 +03:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-10-31 20:42:53 +00:00
2023-09-05 20:00:19 +03:00
2024-02-01 15:22:36 +02:00
2023-11-19 09:56:51 +00:00
2024-06-15 00:57:52 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-01-16 16:27:31 -08:00
2024-01-16 16:27:31 -08:00
2024-01-16 16:27:31 -08:00
2024-08-29 23:43:52 +01:00
2023-11-19 09:56:51 +00:00
2023-08-21 11:47:31 +03:00
2023-09-19 15:15:05 +03:00
2024-03-30 20:50:48 -04:00
2024-08-28 08:39:59 +01:00
2023-09-19 15:15:05 +03:00
2024-10-19 19:46:07 +01:00
2024-01-19 15:31:18 -08:00
2024-02-16 12:15:39 +00:00
2023-11-19 09:56:51 +00:00
2024-02-12 12:54:32 -08:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2024-07-31 16:57:42 -07:00
2024-08-28 08:39:59 +01:00
2024-10-19 19:15:23 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-10-31 20:42:53 +00:00
2023-11-19 09:56:51 +00:00
2024-10-12 20:59:12 -07:00
2024-08-28 08:39:59 +01:00
2024-04-17 13:41:25 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-12-11 12:24:15 -07:00
2023-08-14 11:43:21 -07:00
2024-03-11 07:09:10 -07:00
2024-03-17 03:06:17 +01:00
2023-11-19 09:56:51 +00:00
2023-09-23 22:01:08 +01:00
2024-04-17 13:41:25 +01:00
2023-11-19 09:56:51 +00:00
2024-02-01 15:22:36 +02:00
2023-08-21 11:31:22 -07:00
2024-03-30 20:50:48 -04:00
2023-11-19 09:56:51 +00:00
2024-08-28 08:39:59 +01:00
2024-04-17 13:41:25 +01:00
2023-09-23 22:01:08 +01:00
2023-09-23 22:01:08 +01:00
2023-11-19 09:56:51 +00:00
2024-08-29 23:43:52 +01:00
2024-08-29 23:43:52 +01:00
2024-08-29 23:43:52 +01:00
2024-01-09 20:09:39 -05:00
2024-06-19 03:43:13 +01:00
2023-12-08 16:54:32 -08:00
2023-11-23 02:08:15 +00:00
2023-11-19 09:56:51 +00:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-08-28 08:39:59 +01:00
2024-10-19 19:15:23 +01:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-10-17 11:55:17 +03:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-10-24 13:34:07 +03:00
2023-09-23 22:01:08 +01:00
2023-10-17 11:55:17 +03:00
2024-10-14 15:02:14 +03:00
2024-10-19 19:15:23 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-02-19 21:48:50 +00:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-09-23 22:01:08 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-04-17 13:41:25 +01:00
2024-04-23 19:25:49 +03:00
2023-11-19 09:56:51 +00:00
2024-01-15 01:53:41 -07:00
2023-09-23 22:01:08 +01:00
2023-11-19 09:56:51 +00:00
2024-10-19 19:15:23 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-10-27 16:31:45 +01:00
2024-10-10 11:22:49 +01:00
2024-08-16 09:41:58 -07:00
2024-02-09 13:51:51 -08:00
2023-11-19 09:56:51 +00:00
2024-07-04 21:01:42 +01:00
2023-11-07 00:49:35 +00:00
2024-08-29 23:43:52 +01:00
2024-07-04 21:01:42 +01:00
2023-11-19 00:12:43 +02:00
2024-01-16 16:27:31 -08:00
2024-01-16 16:27:31 -08:00
2024-01-16 16:27:31 -08:00
2024-02-08 23:49:03 +01:00
2024-01-09 14:42:12 +11:00
2024-01-09 14:42:12 +11:00
2024-05-11 02:17:24 -07:00
2024-05-11 02:17:24 -07:00
2024-01-09 14:42:12 +11:00
2023-11-19 09:56:51 +00:00
2024-01-16 05:55:26 +01:00
2024-01-09 14:42:12 +11:00
2024-01-16 05:55:26 +01:00
2024-08-28 08:39:59 +01:00
2024-01-18 00:46:00 +00:00
2023-11-19 09:56:51 +00:00
2024-02-26 16:51:37 -08:00
2024-06-15 00:57:52 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-08-11 07:29:41 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-10-31 20:42:53 +00:00
2023-09-19 15:15:05 +03:00
2024-03-28 15:24:01 +02:00
2024-10-19 19:15:23 +01:00
2024-10-31 20:42:53 +00:00
2024-08-28 08:39:59 +01:00
2023-11-23 02:08:15 +00:00
2023-11-19 09:56:51 +00:00
2024-06-15 00:57:52 +01:00
2024-02-26 16:55:17 -08:00
2023-10-31 01:35:58 +00:00
2024-08-29 23:43:52 +01:00
2024-08-29 23:43:52 +01:00
2024-02-03 19:52:05 +00:00
2024-02-03 19:52:05 +00:00
2024-08-28 08:39:59 +01:00
2023-09-23 22:01:08 +01:00
2024-08-28 08:39:59 +01:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-07-21 01:55:52 -07:00
2023-11-19 11:11:50 +00:00
2023-11-19 09:56:51 +00:00
2023-11-19 09:56:51 +00:00
2024-05-14 01:13:49 +09:00
2024-05-14 01:13:48 +09:00
2023-11-19 09:56:51 +00:00
2023-09-19 15:15:05 +03:00
2023-11-19 09:56:51 +00:00
2024-10-19 19:15:23 +01:00