mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-29 09:04:55 +01:00
Move the operation of resolving the specific decl block from `GetConstantValue()` to `TryEvalTypedInst()`, with is now happening after replacing the fields of the instruction with new constant values, but before running the evaluation of the instruction. Since imported instructions are not evaluated, this avoids resolving the specific decl block from imported instructions, resolving a TODO in `AddImportedConstant()`. Now `AddImportedConstant()` can replace constant values in its fields without having to worry about that operation resolving any specific decl blocks. We get to add a new TODO however, to explain why we still need a special case in resolving specific decl blocks for handling `Impl` construction. The witness table contains instructions with specifics referring to the generic self of the impl declaration. But the table must be constructed before the impl's generic is finished, in order to make the instructions dependent for the generic. But then resolving the specific decl block can't be done when the instructions are created and evaluated, as that requires a finished generic. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>