mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Move type functions off Context (#4951)
This creates a new check/type.h for most logic, and also moves some functions to TypeStore in sem_ir/type.h. My approach for TypeStore is to focus on moving the read-only functions there.
This commit is contained in:
@@ -17,7 +17,7 @@ auto HandleParseNode(Context& context, Parse::WhereOperandId node_id) -> bool {
|
||||
auto self_type_id = ExprAsType(context, self_node, self_id).type_id;
|
||||
// Only facet types may have `where` restrictions.
|
||||
if (self_type_id != SemIR::ErrorInst::SingletonTypeId &&
|
||||
!context.IsFacetType(self_type_id)) {
|
||||
!context.types().IsFacetType(self_type_id)) {
|
||||
CARBON_DIAGNOSTIC(WhereOnNonFacetType, Error,
|
||||
"left argument of `where` operator must be a facet type");
|
||||
context.emitter().Emit(self_node, WhereOnNonFacetType);
|
||||
@@ -107,7 +107,7 @@ auto HandleParseNode(Context& context, Parse::RequirementImplsId node_id)
|
||||
auto lhs_as_type = ExprAsType(context, lhs_node, lhs_id);
|
||||
auto rhs_as_type = ExprAsType(context, rhs_node, rhs_id);
|
||||
if (rhs_as_type.type_id != SemIR::ErrorInst::SingletonTypeId &&
|
||||
!context.IsFacetType(rhs_as_type.type_id)) {
|
||||
!context.types().IsFacetType(rhs_as_type.type_id)) {
|
||||
CARBON_DIAGNOSTIC(
|
||||
ImplsOnNonFacetType, Error,
|
||||
"right argument of `impls` requirement must be a facet type");
|
||||
|
||||
Reference in New Issue
Block a user