mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-30 20:05:02 +01:00
When doing impl lookup with a constraint facet type including the builtin `TypeCanAggregateDestroy`, we look at the type to see if it satisfies it. However if the type is a facet value, we need to look at the FacetType to see if the eventual concrete type is going to satisfy it. Note that we can do this check up front in the `LookupImplWitness()` function without creating a symbolic instruction to be modified by future specifics with a more precise type for the facet value, because the result of `TypeCanAggregateDestroy` does not actually provide a witness, so we don't need the final specific type. This was noticed by removing the "shortcut" in convert for converting a `FacetAccessType(<symbolic binding>)` to `typeof(<symbolic binding>)`. By removing the shortcut, we go into impl lookup when checking `impl` decls containing `TypeCanAggregateDestroy` via deduce.