diff --git a/toolchain/driver/testdata/semantics_builtin_nodes.carbon b/toolchain/driver/testdata/semantics_builtin_nodes.carbon index 75b13af639b8..0ca7279febd1 100644 --- a/toolchain/driver/testdata/semantics_builtin_nodes.carbon +++ b/toolchain/driver/testdata/semantics_builtin_nodes.carbon @@ -17,7 +17,7 @@ // CHECK:STDOUT: ] // CHECK:STDOUT: nodes: [ // CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: nodeTypeType, type: typeTypeType}, -// CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: nodeError, type: typeError}, // CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: nodeBoolType, type: typeTypeType}, // CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: nodeIntegerType, type: typeTypeType}, // CHECK:STDOUT: {kind: CrossReference, arg0: ir0, arg1: nodeFloatingPointType, type: typeTypeType}, diff --git a/toolchain/semantics/semantics_builtin_kind.def b/toolchain/semantics/semantics_builtin_kind.def index f54cbe9d6a32..267246b0583d 100644 --- a/toolchain/semantics/semantics_builtin_kind.def +++ b/toolchain/semantics/semantics_builtin_kind.def @@ -40,9 +40,11 @@ // This has a deliberately self-referential type. CARBON_SEMANTICS_BUILTIN_KIND(TypeType, "Type") -// Used when a SemanticNode has an invalid type, which should then be ignored -// for future type checking. -CARBON_SEMANTICS_BUILTIN_KIND(InvalidType, "") +// Used when a semantic error has been detected, and a SemanticNodeId is still +// required. For example, when there is a type checking issue, this will be used +// in the type_id. It's typically used as a cue that semantic checking doesn't +// need to issue further diagnostics. +CARBON_SEMANTICS_BUILTIN_KIND(Error, "") // ----------------------------------------------------------------------------- // TODO: Below types are all placeholders. While the above may last, the below diff --git a/toolchain/semantics/semantics_context.cpp b/toolchain/semantics/semantics_context.cpp index 271de8e13388..38e3b5319ea6 100644 --- a/toolchain/semantics/semantics_context.cpp +++ b/toolchain/semantics/semantics_context.cpp @@ -33,10 +33,10 @@ SemanticsContext::SemanticsContext(const TokenizedBuffer& tokens, params_or_args_stack_("params_or_args_stack_", semantics_ir, vlog_stream), args_type_info_stack_("args_type_info_stack_", semantics_ir, vlog_stream) { - // Inserts the "Invalid" and "Type" types as "used types" so that + // Inserts the "Error" and "Type" types as "used types" so that // canonicalization can skip them. We don't emit either for lowering. canonical_types_.insert( - {SemanticsNodeId::BuiltinInvalidType, SemanticsTypeId::InvalidType}); + {SemanticsNodeId::BuiltinError, SemanticsTypeId::Error}); canonical_types_.insert( {SemanticsNodeId::BuiltinTypeType, SemanticsTypeId::TypeType}); } @@ -142,7 +142,7 @@ auto SemanticsContext::LookupName(ParseTree::Node parse_node, emitter_->Emit(parse_node, NameNotFound, semantics_ir_->GetString(name_id)); } - return SemanticsNodeId::BuiltinInvalidType; + return SemanticsNodeId::BuiltinError; } CARBON_CHECK(!it->second.empty()) << "Should have been erased: " << semantics_ir_->GetString(name_id); @@ -157,7 +157,7 @@ auto SemanticsContext::LookupName(ParseTree::Node parse_node, emitter_->Emit(parse_node, NameNotFound, semantics_ir_->GetString(name_id)); } - return SemanticsNodeId::BuiltinInvalidType; + return SemanticsNodeId::BuiltinError; } return it->second; @@ -360,7 +360,7 @@ auto SemanticsContext::ApplyDeclarationNameQualifier( auto resolved_node_id = LookupName(name_context.parse_node, name_id, name_context.target_scope_id, /*print_diagnostics=*/false); - if (resolved_node_id == SemanticsNodeId::BuiltinInvalidType) { + if (resolved_node_id == SemanticsNodeId::BuiltinError) { // Invalid indicates an unresolved node. Store it and return. name_context.state = DeclarationNameContext::State::Unresolved; name_context.unresolved_name_id = name_id; @@ -479,20 +479,20 @@ auto SemanticsContext::ImplicitAsImpl(SemanticsNodeId value_id, -> ImplicitAsKind { // Start by making sure both sides are valid. If any part is invalid, the // result is invalid and we shouldn't error. - if (value_id == SemanticsNodeId::BuiltinInvalidType) { + if (value_id == SemanticsNodeId::BuiltinError) { // If the value is invalid, we can't do much, but do "succeed". return ImplicitAsKind::Identical; } auto value = semantics_ir_->GetNode(value_id); auto value_type_id = value.type_id(); - if (value_type_id == SemanticsTypeId::InvalidType) { + if (value_type_id == SemanticsTypeId::Error) { return ImplicitAsKind::Identical; } - if (as_type_id == SemanticsTypeId::InvalidType) { + if (as_type_id == SemanticsTypeId::Error) { // Although the target type is invalid, this still changes the value. if (output_value_id != nullptr) { - *output_value_id = SemanticsNodeId::BuiltinInvalidType; + *output_value_id = SemanticsNodeId::BuiltinError; } return ImplicitAsKind::Compatible; } @@ -519,7 +519,7 @@ auto SemanticsContext::ImplicitAsImpl(SemanticsNodeId value_id, // TODO: Handle ImplicitAs for compatible structs and tuples. if (output_value_id != nullptr) { - *output_value_id = SemanticsNodeId::BuiltinInvalidType; + *output_value_id = SemanticsNodeId::BuiltinError; } return ImplicitAsKind::Incompatible; } diff --git a/toolchain/semantics/semantics_context.h b/toolchain/semantics/semantics_context.h index a087e049cd60..ed023ff646c5 100644 --- a/toolchain/semantics/semantics_context.h +++ b/toolchain/semantics/semantics_context.h @@ -210,7 +210,7 @@ class SemanticsContext { -> bool; // Runs ImplicitAsImpl for a situation where a cast is required, returning the - // updated `value_id`. Prints a diagnostic and returns an InvalidType if + // updated `value_id`. Prints a diagnostic and returns an Error if // unsupported. auto ImplicitAsRequired(ParseTree::Node parse_node, SemanticsNodeId value_id, SemanticsTypeId as_type_id) -> SemanticsNodeId; diff --git a/toolchain/semantics/semantics_handle.cpp b/toolchain/semantics/semantics_handle.cpp index 9ad0cc899418..39c27fd69fda 100644 --- a/toolchain/semantics/semantics_handle.cpp +++ b/toolchain/semantics/semantics_handle.cpp @@ -238,7 +238,7 @@ auto SemanticsHandleMemberAccessExpression(SemanticsContext& context, } // Should only be reached on error. - context.node_stack().Push(parse_node, SemanticsNodeId::BuiltinInvalidType); + context.node_stack().Push(parse_node, SemanticsNodeId::BuiltinError); return true; } diff --git a/toolchain/semantics/semantics_handle_call_expression.cpp b/toolchain/semantics/semantics_handle_call_expression.cpp index 04840712aeda..5efe59d361ea 100644 --- a/toolchain/semantics/semantics_handle_call_expression.cpp +++ b/toolchain/semantics/semantics_handle_call_expression.cpp @@ -32,7 +32,7 @@ auto SemanticsHandleCallExpression(SemanticsContext& context, if (!context.ImplicitAsForArgs(refs_id, name_node.parse_node(), callable.param_refs_id, &diagnostic)) { diagnostic.Emit(); - context.node_stack().Push(parse_node, SemanticsNodeId::BuiltinInvalidType); + context.node_stack().Push(parse_node, SemanticsNodeId::BuiltinError); return true; } diff --git a/toolchain/semantics/semantics_ir.cpp b/toolchain/semantics/semantics_ir.cpp index 278077eba0cd..f8a1f9a8533f 100644 --- a/toolchain/semantics/semantics_ir.cpp +++ b/toolchain/semantics/semantics_ir.cpp @@ -17,14 +17,14 @@ auto SemanticsIR::MakeBuiltinIR() -> SemanticsIR { SemanticsIR semantics_ir(/*builtin_ir=*/nullptr); semantics_ir.nodes_.reserve(SemanticsBuiltinKind::ValidCount); - // InvalidType uses a self-referential type so that it's not accidentally - // treated as a normal type. Every other builtin is a type, including the + // Error uses a self-referential type so that it's not accidentally treated as + // a normal type. Every other builtin is a type, including the // self-referential TypeType. -#define CARBON_SEMANTICS_BUILTIN_KIND(Name, ...) \ - semantics_ir.nodes_.push_back(SemanticsNode::Builtin::Make( \ - SemanticsBuiltinKind::Name, \ - SemanticsBuiltinKind::Name == SemanticsBuiltinKind::InvalidType \ - ? SemanticsTypeId::InvalidType \ +#define CARBON_SEMANTICS_BUILTIN_KIND(Name, ...) \ + semantics_ir.nodes_.push_back(SemanticsNode::Builtin::Make( \ + SemanticsBuiltinKind::Name, \ + SemanticsBuiltinKind::Name == SemanticsBuiltinKind::Error \ + ? SemanticsTypeId::Error \ : SemanticsTypeId::TypeType)); #include "toolchain/semantics/semantics_builtin_kind.def" diff --git a/toolchain/semantics/semantics_ir.h b/toolchain/semantics/semantics_ir.h index b98966b7dfe9..37d4dcf323be 100644 --- a/toolchain/semantics/semantics_ir.h +++ b/toolchain/semantics/semantics_ir.h @@ -225,11 +225,11 @@ class SemanticsIR { return type_id; } - // Gets the node ID for a type. This doesn't handle TypeType or InvalidType in + // Gets the node ID for a type. This doesn't handle TypeType or Error in // order to avoid a check; callers that need that should use // GetTypeAllowBuiltinTypes. auto GetType(SemanticsTypeId type_id) const -> SemanticsNodeId { - // Double-check it's not called with TypeType or InvalidType. + // Double-check it's not called with TypeType or Error. CARBON_CHECK(type_id.index >= 0) << "Invalid argument for GetType: " << type_id; return types_[type_id.index]; @@ -239,8 +239,8 @@ class SemanticsIR { -> SemanticsNodeId { if (type_id == SemanticsTypeId::TypeType) { return SemanticsNodeId::BuiltinTypeType; - } else if (type_id == SemanticsTypeId::InvalidType) { - return SemanticsNodeId::BuiltinInvalidType; + } else if (type_id == SemanticsTypeId::Error) { + return SemanticsNodeId::BuiltinError; } else { return GetType(type_id); } diff --git a/toolchain/semantics/semantics_node.h b/toolchain/semantics/semantics_node.h index 6d0e2eb4ab02..4a098fcde7de 100644 --- a/toolchain/semantics/semantics_node.h +++ b/toolchain/semantics/semantics_node.h @@ -168,8 +168,8 @@ struct SemanticsTypeId : public IndexBase { // The builtin TypeType. static const SemanticsTypeId TypeType; - // The builtin InvalidType. - static const SemanticsTypeId InvalidType; + // The builtin Error. + static const SemanticsTypeId Error; // An explicitly invalid ID. static const SemanticsTypeId Invalid; @@ -179,8 +179,8 @@ struct SemanticsTypeId : public IndexBase { out << "type"; if (index == TypeType.index) { out << "TypeType"; - } else if (index == InvalidType.index) { - out << "InvalidType"; + } else if (index == Error.index) { + out << "Error"; } else { IndexBase::Print(out); } @@ -189,7 +189,7 @@ struct SemanticsTypeId : public IndexBase { constexpr SemanticsTypeId SemanticsTypeId::TypeType = SemanticsTypeId(SemanticsTypeId::InvalidIndex - 2); -constexpr SemanticsTypeId SemanticsTypeId::InvalidType = +constexpr SemanticsTypeId SemanticsTypeId::Error = SemanticsTypeId(SemanticsTypeId::InvalidIndex - 1); constexpr SemanticsTypeId SemanticsTypeId::Invalid = SemanticsTypeId(SemanticsTypeId::InvalidIndex); diff --git a/toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon index d9417874cf16..c717544f0acf 100644 --- a/toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon +++ b/toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon @@ -23,7 +23,7 @@ // CHECK:STDOUT: {kind: BindName, arg0: str0, arg1: node+0, type: type0}, // CHECK:STDOUT: {kind: VarStorage, type: type0}, // CHECK:STDOUT: {kind: BindName, arg0: str1, arg1: node+2, type: type0}, -// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon index 2b0812a79c90..0e5142b3d7ad 100644 --- a/toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon @@ -31,7 +31,7 @@ // CHECK:STDOUT: {kind: VarStorage, type: type2}, // CHECK:STDOUT: {kind: BindName, arg0: str2, arg1: node+4, type: type2}, // CHECK:STDOUT: {kind: Call, arg0: block0, arg1: function0, type: type0}, -// CHECK:STDOUT: {kind: Assign, arg0: node+4, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+4, arg1: nodeError, type: typeError}, // CHECK:STDOUT: {kind: Return}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ diff --git a/toolchain/semantics/testdata/if/fail_scope.carbon b/toolchain/semantics/testdata/if/fail_scope.carbon index e54effa722f9..047dd811c5d7 100644 --- a/toolchain/semantics/testdata/if/fail_scope.carbon +++ b/toolchain/semantics/testdata/if/fail_scope.carbon @@ -33,7 +33,7 @@ // CHECK:STDOUT: {kind: Assign, arg0: node+5, arg1: node+7, type: type1}, // CHECK:STDOUT: {kind: ReturnExpression, arg0: node+5, type: type1}, // CHECK:STDOUT: {kind: Branch, arg0: block6}, -// CHECK:STDOUT: {kind: ReturnExpression, arg0: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: ReturnExpression, arg0: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/operators/fail_type_mismatch.carbon b/toolchain/semantics/testdata/operators/fail_type_mismatch.carbon index cd488d5de806..505744e2d935 100644 --- a/toolchain/semantics/testdata/operators/fail_type_mismatch.carbon +++ b/toolchain/semantics/testdata/operators/fail_type_mismatch.carbon @@ -24,8 +24,8 @@ // CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function0}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int0, type: type0}, // CHECK:STDOUT: {kind: RealLiteral, arg0: real0, type: type1}, -// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: nodeInvalidType, arg1: node+2, type: typeInvalidType}, -// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+3, type: typeInvalidType}, +// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: nodeError, arg1: node+2, type: typeError}, +// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+3, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/operators/fail_type_mismatch_once.carbon b/toolchain/semantics/testdata/operators/fail_type_mismatch_once.carbon index 84320fcf0fc8..8903b32c657d 100644 --- a/toolchain/semantics/testdata/operators/fail_type_mismatch_once.carbon +++ b/toolchain/semantics/testdata/operators/fail_type_mismatch_once.carbon @@ -25,10 +25,10 @@ // CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function0}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int0, type: type0}, // CHECK:STDOUT: {kind: RealLiteral, arg0: real0, type: type1}, -// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: nodeInvalidType, arg1: node+2, type: typeInvalidType}, +// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: nodeError, arg1: node+2, type: typeError}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int1, type: type0}, -// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: node+3, arg1: node+4, type: typeInvalidType}, -// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+5, type: typeInvalidType}, +// CHECK:STDOUT: {kind: BinaryOperatorAdd, arg0: node+3, arg1: node+4, type: typeError}, +// CHECK:STDOUT: {kind: ReturnExpression, arg0: node+5, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/return/fail_type_mismatch.carbon b/toolchain/semantics/testdata/return/fail_type_mismatch.carbon index 6ec2be50512c..801cee6437b1 100644 --- a/toolchain/semantics/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/semantics/testdata/return/fail_type_mismatch.carbon @@ -22,7 +22,7 @@ // CHECK:STDOUT: nodes: [ // CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function0}, // CHECK:STDOUT: {kind: RealLiteral, arg0: real0, type: type1}, -// CHECK:STDOUT: {kind: ReturnExpression, arg0: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: ReturnExpression, arg0: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_assign_empty.carbon b/toolchain/semantics/testdata/struct/fail_assign_empty.carbon index cc89d6534887..cd0900d5587d 100644 --- a/toolchain/semantics/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/semantics/testdata/struct/fail_assign_empty.carbon @@ -26,7 +26,7 @@ // CHECK:STDOUT: {kind: BindName, arg0: str0, arg1: node+2, type: type1}, // CHECK:STDOUT: {kind: StructType, arg0: block0, type: typeTypeType}, // CHECK:STDOUT: {kind: StructValue, arg0: block0, type: type2}, -// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon b/toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon index 7d662d13d16e..ccfc11e9e934 100644 --- a/toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon @@ -30,7 +30,7 @@ // CHECK:STDOUT: {kind: StubReference, arg0: node+4, type: type1}, // CHECK:STDOUT: {kind: StructType, arg0: block2, type: typeTypeType}, // CHECK:STDOUT: {kind: StructValue, arg0: block3, type: type2}, -// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon index ba03644d70f7..ad837a4690a1 100644 --- a/toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon @@ -31,7 +31,7 @@ // CHECK:STDOUT: {kind: StubReference, arg0: node+4, type: type0}, // CHECK:STDOUT: {kind: StructType, arg0: block3, type: typeTypeType}, // CHECK:STDOUT: {kind: StructValue, arg0: block4, type: type2}, -// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon index 5047ffb382e7..8b2a535f253e 100644 --- a/toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon @@ -32,7 +32,7 @@ // CHECK:STDOUT: {kind: StubReference, arg0: node+4, type: type2}, // CHECK:STDOUT: {kind: StructType, arg0: block3, type: typeTypeType}, // CHECK:STDOUT: {kind: StructValue, arg0: block4, type: type3}, -// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_member_access_type.carbon b/toolchain/semantics/testdata/struct/fail_member_access_type.carbon index f9fe0d8d44d6..09a01d6e7d53 100644 --- a/toolchain/semantics/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/semantics/testdata/struct/fail_member_access_type.carbon @@ -34,7 +34,7 @@ // CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: node+7, type: type1}, // CHECK:STDOUT: {kind: VarStorage, type: type2}, // CHECK:STDOUT: {kind: BindName, arg0: str2, arg1: node+9, type: type2}, -// CHECK:STDOUT: {kind: Assign, arg0: node+9, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+9, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_non_member_access.carbon b/toolchain/semantics/testdata/struct/fail_non_member_access.carbon index 4bb69fa0c175..3c4851f579e0 100644 --- a/toolchain/semantics/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/semantics/testdata/struct/fail_non_member_access.carbon @@ -33,7 +33,7 @@ // CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: node+7, type: type1}, // CHECK:STDOUT: {kind: VarStorage, type: type0}, // CHECK:STDOUT: {kind: BindName, arg0: str2, arg1: node+9, type: type0}, -// CHECK:STDOUT: {kind: Assign, arg0: node+9, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+9, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_too_few_values.carbon b/toolchain/semantics/testdata/struct/fail_too_few_values.carbon index 540986605900..fab7df9ad838 100644 --- a/toolchain/semantics/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/semantics/testdata/struct/fail_too_few_values.carbon @@ -32,7 +32,7 @@ // CHECK:STDOUT: {kind: StubReference, arg0: node+5, type: type0}, // CHECK:STDOUT: {kind: StructType, arg0: block3, type: typeTypeType}, // CHECK:STDOUT: {kind: StructValue, arg0: block4, type: type2}, -// CHECK:STDOUT: {kind: Assign, arg0: node+3, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+3, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_type_assign.carbon b/toolchain/semantics/testdata/struct/fail_type_assign.carbon index 6f48db90b8cb..0fcd219ab00a 100644 --- a/toolchain/semantics/testdata/struct/fail_type_assign.carbon +++ b/toolchain/semantics/testdata/struct/fail_type_assign.carbon @@ -24,7 +24,7 @@ // CHECK:STDOUT: {kind: VarStorage, type: type1}, // CHECK:STDOUT: {kind: BindName, arg0: str0, arg1: node+2, type: type1}, // CHECK:STDOUT: {kind: StructTypeField, arg0: str1, type: type0}, -// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/struct/fail_value_as_type.carbon b/toolchain/semantics/testdata/struct/fail_value_as_type.carbon index d29de60147c6..e7eb0a953d68 100644 --- a/toolchain/semantics/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/semantics/testdata/struct/fail_value_as_type.carbon @@ -25,8 +25,8 @@ // CHECK:STDOUT: {kind: StubReference, arg0: node+0, type: type0}, // CHECK:STDOUT: {kind: StructType, arg0: block2, type: typeTypeType}, // CHECK:STDOUT: {kind: StructValue, arg0: block3, type: type1}, -// CHECK:STDOUT: {kind: VarStorage, type: typeInvalidType}, -// CHECK:STDOUT: {kind: BindName, arg0: str0, arg1: node+5, type: typeInvalidType}, +// CHECK:STDOUT: {kind: VarStorage, type: typeError}, +// CHECK:STDOUT: {kind: BindName, arg0: str0, arg1: node+5, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon b/toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon index 92d1f9ccf82b..0b0fa0adfc47 100644 --- a/toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon +++ b/toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon @@ -26,7 +26,7 @@ // CHECK:STDOUT: {kind: VarStorage, type: type1}, // CHECK:STDOUT: {kind: BindName, arg0: str1, arg1: node+1, type: type1}, // CHECK:STDOUT: {kind: RealLiteral, arg0: real0, type: type2}, -// CHECK:STDOUT: {kind: Assign, arg0: node+1, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+1, arg1: nodeError, type: typeError}, // CHECK:STDOUT: {kind: Return}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ diff --git a/toolchain/semantics/testdata/var/fail_init_with_self.carbon b/toolchain/semantics/testdata/var/fail_init_with_self.carbon index 6d48d4ce8af9..22f9ec5624ae 100644 --- a/toolchain/semantics/testdata/var/fail_init_with_self.carbon +++ b/toolchain/semantics/testdata/var/fail_init_with_self.carbon @@ -23,7 +23,7 @@ // CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function0}, // CHECK:STDOUT: {kind: VarStorage, type: type1}, // CHECK:STDOUT: {kind: BindName, arg0: str1, arg1: node+1, type: type1}, -// CHECK:STDOUT: {kind: Assign, arg0: node+1, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+1, arg1: nodeError, type: typeError}, // CHECK:STDOUT: {kind: Return}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ diff --git a/toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon b/toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon index 7be851a90eea..f4c78e5acd2a 100644 --- a/toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon +++ b/toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon @@ -27,7 +27,7 @@ // CHECK:STDOUT: {kind: Return}, // CHECK:STDOUT: {kind: VarStorage, type: type1}, // CHECK:STDOUT: {kind: BindName, arg0: str2, arg1: node+4, type: type1}, -// CHECK:STDOUT: {kind: Assign, arg0: node+4, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+4, arg1: nodeError, type: typeError}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [ // CHECK:STDOUT: [ diff --git a/toolchain/semantics/testdata/var/fail_storage_is_literal.carbon b/toolchain/semantics/testdata/var/fail_storage_is_literal.carbon index bde1601a1b1e..8f2b870c3f5d 100644 --- a/toolchain/semantics/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/semantics/testdata/var/fail_storage_is_literal.carbon @@ -24,10 +24,10 @@ // CHECK:STDOUT: nodes: [ // CHECK:STDOUT: {kind: FunctionDeclaration, arg0: function0}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int0, type: type1}, -// CHECK:STDOUT: {kind: VarStorage, type: typeInvalidType}, -// CHECK:STDOUT: {kind: BindName, arg0: str1, arg1: node+2, type: typeInvalidType}, +// CHECK:STDOUT: {kind: VarStorage, type: typeError}, +// CHECK:STDOUT: {kind: BindName, arg0: str1, arg1: node+2, type: typeError}, // CHECK:STDOUT: {kind: IntegerLiteral, arg0: int1, type: type1}, -// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeInvalidType, type: typeInvalidType}, +// CHECK:STDOUT: {kind: Assign, arg0: node+2, arg1: nodeError, type: typeError}, // CHECK:STDOUT: {kind: Return}, // CHECK:STDOUT: ] // CHECK:STDOUT: node_blocks: [