Nate Biggs
92ae8b61ec
[dart2wasm] Fix switch statements that include a Type expression case.
...
'canInvokeTypeEquality' was assuming that if a single case was a Type expression, then type equality should be used for the whole switch statement. This is incorrect because if a single case is a type expression but the rest are, for example, ints (as in the fixed test) then the int cases should be compared with identical while only the type expression should be compared with ==.
More importantly, the expected type of the case expression constants should be top type rather than the Type type. Top type is the union of Type and the other case type.
Switches that only include Type expressions will now use "top" type as well but in general switching on a Type expression is an antipattern we shouldn't optimize for. And the impact of not specializing the switch type to Type should be very minimal.
Fixes: https://github.com/dart-lang/sdk/issues/63476
Change-Id: Ib96172f157d8cf3093199e5127d4835e7b25011c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509920
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Nate Biggs <natebiggs@google.com >
2026-06-09 20:39:04 -07:00
..
2025-04-29 07:38:43 -07:00
2026-05-27 06:04:46 -07:00
2025-02-19 04:21:42 -08:00
2025-06-24 01:16:24 -07:00
2024-12-13 10:52:25 -08:00
2026-01-26 01:49:03 -08:00
2024-12-20 02:39:21 -08:00
2026-04-09 15:01:17 -07:00
2025-10-24 09:31:25 -07:00
2025-06-17 04:03:26 -07:00
2026-02-17 08:28:57 -08:00
2025-07-30 13:56:40 -07:00
2026-02-17 08:28:57 -08:00
2026-05-29 12:57:07 -07:00
2026-05-28 09:19:15 -07:00
2026-01-13 02:46:44 -08:00
2025-10-27 01:35:09 -07:00
2026-04-01 01:17:28 -07:00
2026-04-15 03:08:56 -07:00
2025-04-29 07:38:43 -07:00
2026-04-01 01:17:28 -07:00
2025-06-02 10:59:31 -07:00
2025-10-27 01:35:09 -07:00
2024-12-12 15:50:08 -08:00
2025-11-28 03:23:01 -08:00
2026-05-28 05:13:49 -07:00
2025-02-19 04:21:42 -08:00
2025-04-29 07:38:43 -07:00
2025-06-17 04:03:26 -07:00
2026-05-04 15:09:49 -07:00
2025-02-19 04:21:42 -08:00
2025-04-29 07:38:43 -07:00
2025-09-01 03:59:59 -07:00
2026-05-04 15:09:49 -07:00
2025-06-17 04:03:26 -07:00
2025-02-26 10:39:51 -08:00
2025-05-26 08:08:31 -07:00
2026-04-01 01:17:28 -07:00
2025-04-29 07:37:05 -07:00
2025-10-27 01:35:09 -07:00
2025-04-29 07:37:05 -07:00
2025-06-24 01:16:24 -07:00
2025-04-29 07:37:05 -07:00
2025-07-24 07:21:26 -07:00
2025-10-27 01:35:09 -07:00
2024-11-21 10:49:44 +00:00
2025-02-05 08:36:21 -08:00
2025-06-17 04:03:26 -07:00
2025-04-29 07:37:05 -07:00
2025-02-05 08:36:21 -08:00
2025-02-19 04:21:42 -08:00
2026-04-30 11:05:39 -07:00
2025-04-29 07:37:05 -07:00
2026-05-06 13:23:57 -07:00
2025-04-29 07:37:05 -07:00
2024-10-16 17:54:39 +00:00
2025-08-27 04:59:03 -07:00
2025-02-19 04:21:42 -08:00
2025-10-27 01:35:09 -07:00
2025-04-29 07:37:05 -07:00
2026-05-04 15:09:49 -07:00
2025-02-05 08:36:21 -08:00
2025-06-17 04:03:26 -07:00
2025-02-19 04:21:42 -08:00
2025-04-29 07:37:05 -07:00
2025-06-17 04:03:26 -07:00
2026-05-20 00:22:27 -07:00
2025-02-19 04:21:42 -08:00
2026-02-17 08:28:57 -08:00
2024-11-21 10:49:44 +00:00
2025-02-19 04:21:42 -08:00
2026-02-17 08:28:57 -08:00
2025-05-19 00:18:57 -07:00
2025-10-27 01:35:09 -07:00
2026-04-27 09:42:38 -07:00
2026-05-29 12:57:07 -07:00
2025-02-11 00:23:41 -08:00
2026-05-18 07:55:50 -07:00
2026-05-29 12:57:07 -07:00
2025-09-24 01:18:32 -07:00
2025-02-19 04:21:42 -08:00
2026-02-21 10:59:44 -08:00
2025-06-24 01:16:24 -07:00
2026-04-01 15:20:26 -07:00
2025-06-24 01:16:24 -07:00
2025-10-27 01:35:09 -07:00
2025-08-27 02:00:02 -07:00
2025-09-09 04:50:35 -07:00
2025-06-27 02:29:33 -07:00
2025-11-14 03:01:16 -08:00
2025-10-27 01:35:09 -07:00
2025-06-17 04:03:26 -07:00
2026-04-17 23:06:25 -07:00
2025-09-30 06:52:53 -07:00
2025-09-24 01:18:32 -07:00
2025-09-04 01:22:53 -07:00
2026-06-04 09:52:40 -07:00
2026-02-17 08:28:57 -08:00
2026-05-28 05:13:49 -07:00
2025-02-11 15:31:25 -08:00
2026-02-06 16:06:56 -08:00
2025-10-27 01:35:09 -07:00
2026-03-20 09:09:46 -07:00
2026-04-17 23:06:25 -07:00
2025-06-17 04:03:26 -07:00
2025-05-02 04:46:00 -07:00
2025-05-02 04:46:00 -07:00
2026-02-12 13:02:56 -08:00
2025-05-02 04:46:00 -07:00
2026-05-04 15:09:49 -07:00
2025-09-09 04:50:35 -07:00
2025-05-02 04:46:00 -07:00
2026-01-28 04:41:56 -08:00
2026-02-17 08:28:57 -08:00
2025-10-27 01:35:09 -07:00
2026-01-12 11:04:03 -08:00
2024-11-28 09:10:30 +00:00
2026-06-09 20:39:04 -07:00
2025-06-17 04:03:26 -07:00
2026-04-09 15:01:17 -07:00
2025-10-27 01:35:09 -07:00
2026-03-24 05:22:10 -07:00
2025-10-27 01:35:09 -07:00
2025-10-27 01:35:09 -07:00
2025-05-02 04:28:39 -07:00
2026-02-17 08:28:57 -08:00
2026-05-04 10:37:11 -07:00
2026-04-09 09:34:54 -07:00
2025-05-02 04:28:39 -07:00
2026-02-17 08:28:57 -08:00
2025-05-02 04:14:03 -07:00
2026-04-01 01:17:28 -07:00
2026-03-24 13:29:17 -07:00
2025-09-22 04:49:24 -07:00
2026-05-06 13:23:57 -07:00
2025-06-17 04:03:26 -07:00
2024-12-20 02:39:21 -08:00
2024-10-11 16:53:52 +00:00
2024-08-16 11:49:19 +00:00
2025-08-18 12:38:35 -07:00
2024-07-11 13:54:13 +00:00
2024-06-12 10:21:23 +00:00
2026-04-24 10:49:11 -07:00
2024-07-30 03:13:58 +00:00
2026-01-21 04:58:13 -08:00
2026-01-21 04:58:13 -08:00
2025-10-27 01:35:09 -07:00
2023-10-09 19:30:29 +00:00
2025-09-29 11:04:13 -07:00
2026-01-07 03:38:06 -08:00
2023-11-16 18:18:00 +00:00
2025-01-02 03:27:35 -08:00
2025-01-02 03:27:35 -08:00
2025-04-29 07:38:43 -07:00
2024-05-17 12:07:56 +00:00
2024-07-05 07:38:49 +00:00
2024-10-11 16:53:52 +00:00
2025-01-02 03:27:35 -08:00
2025-04-29 07:38:43 -07:00
2025-01-02 03:27:35 -08:00