Commit a3ae0ec
committed
Improve type inference for @something
`@something` eagerly unwraps any `Some` given to it,
while keeping the variable between its arguments the same.
This can be an issue if a previously unpacked value is used as input
to `@something`, leading to a type instability on more than two arguments
(e.g. because of a fallback to `Some(nothing)`). By using different
variables for each argument, type inference has an easier time handling
these cases that are isolated to single branches anyway.1 parent 0c46852 commit a3ae0ec
1 file changed
+25
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
142 | 155 | | |
143 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
144 | 166 | | |
145 | | - | |
146 | | - | |
| 167 | + | |
147 | 168 | | |
0 commit comments