Commit 3420ef1
authored
Fix ternary union for literals (#18023)
Fixes #18021
When I switched to (almost) always using unions as inferred from ternary
expressions, I had a choice, because before we used either full context
(i.e. l.h.s.) or the if type to infer the else type. After some playing
I found the second one usually works better. But as we see this is not
always the case, so I add some special-casing.1 parent eb0575e commit 3420ef1
2 files changed
+30
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5805 | 5805 | | |
5806 | 5806 | | |
5807 | 5807 | | |
| 5808 | + | |
| 5809 | + | |
| 5810 | + | |
| 5811 | + | |
| 5812 | + | |
| 5813 | + | |
5808 | 5814 | | |
5809 | 5815 | | |
5810 | 5816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2960 | 2960 | | |
2961 | 2961 | | |
2962 | 2962 | | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
0 commit comments