mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:30:14 +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:
+13
-13
@@ -106,8 +106,8 @@ library "[[@TEST_NAME]]";
|
||||
// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %empty_tuple.type, () [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.4e0: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.c00: %DestroyT.as_type.as.Destroy.impl.Op.type.4e0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.789: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.93e: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.789 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %B.type: type = fn_type @B [concrete]
|
||||
// CHECK:STDOUT: %B: %B.type = struct_value () [concrete]
|
||||
@@ -162,11 +162,11 @@ library "[[@TEST_NAME]]";
|
||||
// CHECK:STDOUT: %.loc20_11: init %empty_tuple.type = converted %c.ref.loc20, %.loc20_10 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%empty_tuple.type, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc18_3: %type_where = converted constants.%empty_tuple.type, %facet_value [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %c.var, constants.%DestroyT.as_type.as.Destroy.impl.Op.c00
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %c.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.93e
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.var, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
|
||||
// CHECK:STDOUT: %addr: %ptr.843 = addr_of %c.var
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
|
||||
// CHECK:STDOUT: return %.loc20_11 to %return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -226,8 +226,8 @@ library "[[@TEST_NAME]]";
|
||||
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %empty_tuple.type, () [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.type.4e0: type = fn_type @DestroyT.as_type.as.Destroy.impl.Op, @DestroyT.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.c00: %DestroyT.as_type.as.Destroy.impl.Op.type.4e0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.789: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.93e: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.789 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -254,19 +254,19 @@ library "[[@TEST_NAME]]";
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %facet_value.loc17: %type_where = facet_value constants.%empty_tuple.type, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc17_7.4: %type_where = converted constants.%empty_tuple.type, %facet_value.loc17 [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc17: <bound method> = bound_method %.loc17_7.2, constants.%DestroyT.as_type.as.Destroy.impl.Op.c00
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc17: <bound method> = bound_method %.loc17_7.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.93e
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method.loc17: <bound method> = bound_method %.loc17_7.2, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.1
|
||||
// CHECK:STDOUT: %bound_method.loc17: <bound method> = bound_method %.loc17_7.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
|
||||
// CHECK:STDOUT: %addr.loc17: %ptr.843 = addr_of %.loc17_7.2
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc17: init %empty_tuple.type = call %bound_method.loc17(%addr.loc17)
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc17: init %empty_tuple.type = call %bound_method.loc17(%addr.loc17)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %facet_value.loc13: %type_where = facet_value constants.%empty_tuple.type, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc13_7.4: %type_where = converted constants.%empty_tuple.type, %facet_value.loc13 [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.bound.loc13: <bound method> = bound_method %.loc13_7.2, constants.%DestroyT.as_type.as.Destroy.impl.Op.c00
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc13: <bound method> = bound_method %.loc13_7.2, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.93e
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %.loc13_7.2, %DestroyT.as_type.as.Destroy.impl.Op.specific_fn.3
|
||||
// CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %.loc13_7.2, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
|
||||
// CHECK:STDOUT: %addr.loc13: %ptr.843 = addr_of %.loc13_7.2
|
||||
// CHECK:STDOUT: %DestroyT.as_type.as.Destroy.impl.Op.call.loc13: init %empty_tuple.type = call %bound_method.loc13(%addr.loc13)
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc13: init %empty_tuple.type = call %bound_method.loc13(%addr.loc13)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user