mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 13:51:04 +01:00
Make BindSymbolicName the canonical form of a FacetValue wrapping the BindSymbolicName (#6107)
If a `BindSymbolicName` is converted to `type` and then to its exact `FacetType`, we get a `FacetValue` wrapping the `BindSymbolicName` but providing no different information: it has the same witnesses and `FacetType` as the original `BindSymbolicName`. Yet it is a different constant value, creating multiple canonical forms with the same meaning. Now we make that `FacetValue` with the same `FacetType` as the `BindSymbolicName` it wraps evaluate back to the `BindSymbolicName`, making it the unique canonical form. This makes the "shortcut" in convert for avoiding impl lookup when converting from `FacetAccessType` to `FacetType` in this exact scenario work the same as doing the full impl lookup. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
737c329aba
commit
82679e6689
@@ -330,8 +330,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %Copy.impl_witness.692: <witness> = impl_witness imports.%Copy.impl_witness_table.53c, @ptr.as.Copy.impl(%S) [concrete]
|
||||
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.bf9: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%S) [concrete]
|
||||
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.1cb: %ptr.as.Copy.impl.Op.type.bf9 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet.7cc: %Copy.type = facet_value %ptr.5c7, (%Copy.impl_witness.692) [concrete]
|
||||
// CHECK:STDOUT: %.dce: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.7cc [concrete]
|
||||
// CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %ptr.5c7, (%Copy.impl_witness.692) [concrete]
|
||||
// CHECK:STDOUT: %.dce: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
|
||||
// CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %ptr.as.Copy.impl.Op.1cb, @ptr.as.Copy.impl.Op(%S) [concrete]
|
||||
// CHECK:STDOUT: %.c5d: type = cpp_overload_set_type @Copy.Op [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %.c5d = struct_value () [concrete]
|
||||
|
||||
Reference in New Issue
Block a user