mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 16:31:04 +01:00
Make FacetAccessType evaluate to SymbolicBindingType for type-of a BindSymbolicName (#6115)
The SymbolicBindingType refers to the type value that will be substituted in for the BindSymbolicName, but holds onto the EntityNameId from the BindSymbolicName instead of (or in addition to, for now) the instruction. The EntityNameId will be used to look in the ScopeStack to find the witnesses either from the BindSymbolicName instruction, or other instructions that specify `impls` constraints against the EntityName. This will allow us to have the `T` in `I(T)` resolve to a `.Self` reference in the type so that we get type equality with the binding's type: `T:! I(.Self)`.
This commit is contained in:
+24
-24
@@ -71,18 +71,18 @@ fn F() {
|
||||
// CHECK:STDOUT: %facet_type: type = facet_type <@Y & @W> [concrete]
|
||||
// CHECK:STDOUT: %E: %facet_type = bind_symbolic_name E, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.50c: type = pattern_type %facet_type [concrete]
|
||||
// CHECK:STDOUT: %E.as_type: type = facet_access_type %E [symbolic]
|
||||
// CHECK:STDOUT: %E.binding.as_type: type = symbolic_binding_type E, 0, %E [symbolic]
|
||||
// CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %E, @Y [symbolic]
|
||||
// CHECK:STDOUT: %Y.facet.682: %Y.type = facet_value %E.as_type, (%Y.lookup_impl_witness) [symbolic]
|
||||
// CHECK:STDOUT: %CC.6f9: type = class_type @CC, @CC(%Y.facet.682) [symbolic]
|
||||
// CHECK:STDOUT: %Z.impl_witness.3fa: <witness> = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%E) [symbolic]
|
||||
// CHECK:STDOUT: %Y.facet.8d8: %Y.type = facet_value %E.binding.as_type, (%Y.lookup_impl_witness) [symbolic]
|
||||
// CHECK:STDOUT: %CC.f67: type = class_type @CC, @CC(%Y.facet.8d8) [symbolic]
|
||||
// CHECK:STDOUT: %Z.impl_witness.62d: <witness> = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%E) [symbolic]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Y.facet.4e8: %Y.type = facet_value %DD, (%Y.impl_witness) [concrete]
|
||||
// CHECK:STDOUT: %CC.3b3: type = class_type @CC, @CC(%Y.facet.4e8) [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %facet_type = facet_value %DD, (%Y.impl_witness, %W.impl_witness) [concrete]
|
||||
// CHECK:STDOUT: %Z.impl_witness.8f8: <witness> = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %CC.3b3, (%Z.impl_witness.8f8) [concrete]
|
||||
// CHECK:STDOUT: %Z.impl_witness.23f: <witness> = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %CC.3b3, (%Z.impl_witness.23f) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -137,10 +137,10 @@ fn F() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic]
|
||||
// CHECK:STDOUT: %E.ref: %facet_type = name_ref E, %E.loc19_14.1 [symbolic = %E.loc19_14.2 (constants.%E)]
|
||||
// CHECK:STDOUT: %E.as_type.loc19_29.1: type = facet_access_type %E.ref [symbolic = %E.as_type.loc19_29.2 (constants.%E.as_type)]
|
||||
// CHECK:STDOUT: %Y.facet.loc19_29.1: %Y.type = facet_value %E.as_type.loc19_29.1, (constants.%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.682)]
|
||||
// CHECK:STDOUT: %.loc19_29: %Y.type = converted %E.ref, %Y.facet.loc19_29.1 [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.682)]
|
||||
// CHECK:STDOUT: %CC.loc19_29.1: type = class_type @CC, @CC(constants.%Y.facet.682) [symbolic = %CC.loc19_29.2 (constants.%CC.6f9)]
|
||||
// CHECK:STDOUT: %E.as_type: type = facet_access_type %E.ref [symbolic = %E.binding.as_type (constants.%E.binding.as_type)]
|
||||
// CHECK:STDOUT: %Y.facet.loc19_29.1: %Y.type = facet_value %E.as_type, (constants.%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.8d8)]
|
||||
// CHECK:STDOUT: %.loc19_29: %Y.type = converted %E.ref, %Y.facet.loc19_29.1 [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.8d8)]
|
||||
// CHECK:STDOUT: %CC.loc19_29.1: type = class_type @CC, @CC(constants.%Y.facet.8d8) [symbolic = %CC.loc19_29.2 (constants.%CC.f67)]
|
||||
// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
|
||||
// CHECK:STDOUT: %.loc19_20.1: type = splice_block %.loc19_20.3 [concrete = constants.%facet_type] {
|
||||
// CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
@@ -155,7 +155,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %E.loc19_14.1: %facet_type = bind_symbolic_name E, 0 [symbolic = %E.loc19_14.2 (constants.%E)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @CC.as.Z.impl [concrete]
|
||||
// CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(constants.%E) [symbolic = @CC.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.3fa)]
|
||||
// CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(constants.%E) [symbolic = @CC.as.Z.impl.%Z.impl_witness (constants.%Z.impl_witness.62d)]
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -195,11 +195,11 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic impl @CC.as.Z.impl(%E.loc19_14.1: %facet_type) {
|
||||
// CHECK:STDOUT: %E.loc19_14.2: %facet_type = bind_symbolic_name E, 0 [symbolic = %E.loc19_14.2 (constants.%E)]
|
||||
// CHECK:STDOUT: %E.as_type.loc19_29.2: type = facet_access_type %E.loc19_14.2 [symbolic = %E.as_type.loc19_29.2 (constants.%E.as_type)]
|
||||
// CHECK:STDOUT: %E.binding.as_type: type = symbolic_binding_type E, 0, %E.loc19_14.2 [symbolic = %E.binding.as_type (constants.%E.binding.as_type)]
|
||||
// CHECK:STDOUT: %Y.lookup_impl_witness: <witness> = lookup_impl_witness %E.loc19_14.2, @Y [symbolic = %Y.lookup_impl_witness (constants.%Y.lookup_impl_witness)]
|
||||
// CHECK:STDOUT: %Y.facet.loc19_29.2: %Y.type = facet_value %E.as_type.loc19_29.2, (%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.682)]
|
||||
// CHECK:STDOUT: %CC.loc19_29.2: type = class_type @CC, @CC(%Y.facet.loc19_29.2) [symbolic = %CC.loc19_29.2 (constants.%CC.6f9)]
|
||||
// CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%E.loc19_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.3fa)]
|
||||
// CHECK:STDOUT: %Y.facet.loc19_29.2: %Y.type = facet_value %E.binding.as_type, (%Y.lookup_impl_witness) [symbolic = %Y.facet.loc19_29.2 (constants.%Y.facet.8d8)]
|
||||
// CHECK:STDOUT: %CC.loc19_29.2: type = class_type @CC, @CC(%Y.facet.loc19_29.2) [symbolic = %CC.loc19_29.2 (constants.%CC.f67)]
|
||||
// CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness file.%Z.impl_witness_table, @CC.as.Z.impl(%E.loc19_14.2) [symbolic = %Z.impl_witness (constants.%Z.impl_witness.62d)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
@@ -241,7 +241,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
|
||||
// CHECK:STDOUT: %facet_value: %facet_type = facet_value constants.%DD, (constants.%Y.impl_witness, constants.%W.impl_witness) [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc22_12.1: %facet_type = converted constants.%DD, %facet_value [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %CC, (constants.%Z.impl_witness.8f8) [concrete = constants.%Z.facet]
|
||||
// CHECK:STDOUT: %Z.facet: %Z.type = facet_value %CC, (constants.%Z.impl_witness.23f) [concrete = constants.%Z.facet]
|
||||
// CHECK:STDOUT: %.loc22_12.2: %Z.type = converted %CC, %Z.facet [concrete = constants.%Z.facet]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -250,17 +250,17 @@ fn F() {
|
||||
// CHECK:STDOUT: %D.loc12_10.1 => constants.%D
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @CC(constants.%Y.facet.682) {
|
||||
// CHECK:STDOUT: %D.loc12_10.1 => constants.%Y.facet.682
|
||||
// CHECK:STDOUT: specific @CC(constants.%Y.facet.8d8) {
|
||||
// CHECK:STDOUT: %D.loc12_10.1 => constants.%Y.facet.8d8
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @CC.as.Z.impl(constants.%E) {
|
||||
// CHECK:STDOUT: %E.loc19_14.2 => constants.%E
|
||||
// CHECK:STDOUT: %E.as_type.loc19_29.2 => constants.%E.as_type
|
||||
// CHECK:STDOUT: %E.binding.as_type => constants.%E.binding.as_type
|
||||
// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.lookup_impl_witness
|
||||
// CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.682
|
||||
// CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.6f9
|
||||
// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.3fa
|
||||
// CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.8d8
|
||||
// CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.f67
|
||||
// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.62d
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @CC(constants.%Y.facet.4e8) {
|
||||
@@ -269,11 +269,11 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @CC.as.Z.impl(constants.%facet_value) {
|
||||
// CHECK:STDOUT: %E.loc19_14.2 => constants.%facet_value
|
||||
// CHECK:STDOUT: %E.as_type.loc19_29.2 => constants.%DD
|
||||
// CHECK:STDOUT: %E.binding.as_type => constants.%DD
|
||||
// CHECK:STDOUT: %Y.lookup_impl_witness => constants.%Y.impl_witness
|
||||
// CHECK:STDOUT: %Y.facet.loc19_29.2 => constants.%Y.facet.4e8
|
||||
// CHECK:STDOUT: %CC.loc19_29.2 => constants.%CC.3b3
|
||||
// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.8f8
|
||||
// CHECK:STDOUT: %Z.impl_witness => constants.%Z.impl_witness.23f
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
Reference in New Issue
Block a user