Files
Odin/src
korvahkh 02246ac6fd Implement fixes for constant unions
Note that with this commit, casting through
multiply-nested unions is forbidden, e.g.
```
U :: union {int, V}
V :: union {bool}
x: U = true
```
does not compile.
(Previously the compiler would simply crash)

This is to avoid situations where adding variants
can lead to unexpected changes in the value.

For example if `U` is changed to have a `bool`
variant of its own:
```
U :: union {int, bool, V}
```
Then `x: U = true` would equal
`U(true)` instead of `U(V(true))`.

Single-variant unions are exempt, primarily to
improve the ergonomics of `Maybe` in cases like:
```
x: Maybe(union{int, bool}) = 1
```

Fix #6100
Fix #6699
Fix #6895
Fix #6896
Fix #6897
Fix #7036
Fix #7083
Fix #7091
2026-08-19 20:12:56 -05:00
..
2026-08-19 11:58:48 +02:00
2025-03-18 15:39:18 +00:00
&&
2024-11-07 15:02:19 +01:00
2026-08-13 20:47:16 -07:00
2026-03-19 08:27:09 +09:00
2026-08-19 15:50:55 -07:00
2026-08-09 12:04:08 -07:00
2026-08-18 14:57:34 +01:00
2021-08-29 15:54:56 +02:00
2026-06-30 22:44:28 +02:00
2026-04-11 12:51:22 +02:00
2026-06-29 17:01:44 +01:00
2026-08-17 19:54:21 +01:00
2026-08-18 14:57:34 +01:00
2022-12-18 21:17:07 +00:00
2026-03-17 12:55:25 +00:00
2025-08-02 12:33:33 +01:00
2026-05-12 18:24:08 -04:00
2024-04-26 13:25:08 +01:00
2026-08-12 16:08:58 +01:00
2026-08-19 20:12:56 -05:00
2026-07-01 22:54:48 -04:00