Commit e12d1b6
authored
Handle a specific providing ImplWitnessAccess for a symbolic binding used as a type (#6201)
SymbolicBindingType evaluates to the type component of a symbolic facet
value (a type/witnesses pair), and that symbolic facet value has its
constant value replaced by a specific. That specific can provide a
FacetValue, in which case it just evaluates to that FacetValue's type
component. It can provide a BindSymbolicName of another binding, in
which case it points to that entity instead and awaits a further
specific. Currently the code only handles these two cases, and they
match the behaviour of the evaluation of FacetAccessType itself.
However FacetAccessType evaluation also handles cases beyond these, as
there are other instructions that occur as facet values, such as
ImplWitnessAccess, when accessing an associated constant of an interface
that has a facet type as its type.
Currently eval then crashes in this scenario. Instead of furthering to
reproduce the contents of FacetAccessType's evaluation, defer to calling
the `EvalConstantInst()` overload for it when evaluating
SymbolicBindingType against a new value from a specific. This means
SymbolicBindingType can evaluate back into a FacetAccessType, when it
was originally a FacetAccessType(BindSymbolicName) and becomes
FacetAccessType(ImplWitnessAccess) through a specific.
This comes with a test that crashed in eval before this change.1 parent b2c2bdd commit e12d1b6
2 files changed
+54
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2178 | 2178 | | |
2179 | 2179 | | |
2180 | 2180 | | |
2181 | | - | |
2182 | | - | |
2183 | | - | |
2184 | | - | |
2185 | | - | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
2190 | 2185 | | |
2191 | | - | |
2192 | | - | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
2196 | 2186 | | |
2197 | 2187 | | |
2198 | 2188 | | |
2199 | 2189 | | |
2200 | | - | |
2201 | | - | |
2202 | | - | |
2203 | | - | |
2204 | | - | |
2205 | | - | |
2206 | | - | |
2207 | | - | |
2208 | | - | |
2209 | | - | |
2210 | | - | |
2211 | | - | |
2212 | | - | |
2213 | | - | |
2214 | | - | |
2215 | | - | |
2216 | | - | |
2217 | | - | |
2218 | | - | |
2219 | | - | |
2220 | | - | |
2221 | | - | |
2222 | | - | |
2223 | 2190 | | |
2224 | | - | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
2225 | 2203 | | |
2226 | 2204 | | |
2227 | 2205 | | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
2235 | 2210 | | |
2236 | 2211 | | |
2237 | 2212 | | |
2238 | 2213 | | |
2239 | 2214 | | |
2240 | 2215 | | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
2241 | 2221 | | |
2242 | 2222 | | |
2243 | 2223 | | |
2244 | 2224 | | |
2245 | | - | |
| 2225 | + | |
2246 | 2226 | | |
2247 | 2227 | | |
2248 | 2228 | | |
2249 | | - | |
| 2229 | + | |
2250 | 2230 | | |
2251 | 2231 | | |
2252 | 2232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
386 | 413 | | |
387 | 414 | | |
388 | 415 | | |
| |||
0 commit comments