Repository navigation
Commit 2da9969
committed
Narrow union disambiguation to str, preserving the structural-ambiguity guard
The general exact-type tie-break removed the guard that makes structurally-
identical union variants (e.g. Union[A, B] dataclasses, Union[int, UnsignedInt])
raise on to_literal -- they would then be indistinguishable on read-back. Keep
that guard; only a bare string prefers the str variant over an enum-by-value.
Signed-off-by: 1fanwang <1fannnw@gmail.com>1 parent ef75c06 commit 2da9969
2 files changed
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2097 | 2097 | | |
2098 | 2098 | | |
2099 | 2099 | | |
2100 | | - | |
2101 | | - | |
2102 | | - | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
2103 | 2103 | | |
2104 | 2104 | | |
2105 | 2105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2047 | 2047 | | |
2048 | 2048 | | |
2049 | 2049 | | |
2050 | | - | |
2051 | | - | |
2052 | | - | |
| 2050 | + | |
| 2051 | + | |
2053 | 2052 | | |
2054 | 2053 | | |
2055 | 2054 | | |
| |||
0 commit comments