Rebuild the type of constants during evaluation. (#4138)

When evaluating in a generic context, a constant with a symbolic type
might evaluate to a constant with a concrete type (or a more specific
symbolic type). This can't actually happen yet given the current state
of the toolchain, as far as I can determine, so this is more just a
refactoring for now, but will be relied upon by future generics work.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
This commit is contained in:
Richard Smith
2024-07-16 22:58:17 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins Carbon Infra Bot
parent 5006838f1c
commit cd7c10b8e2
12 changed files with 105 additions and 72 deletions
-1
View File
@@ -24,7 +24,6 @@ fn G(T:! type) {
// CHECK:STDOUT: %.3: type = array_type %.2, %T [symbolic]
// CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic]
// CHECK:STDOUT: %array: %.3 = tuple_value () [symbolic]
// CHECK:STDOUT: %.5: type = ptr_type @G.%.loc13_17 (%.3) [symbolic]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {