From 62c36ecedac902a3ca3bc22974134e7dd509f92f Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Fri, 18 Oct 2024 15:33:56 -0700 Subject: [PATCH] Support printing the diagnostic kind for verification. (#4425) This is to help identify which diagnostics we're actually using. Note that driver/testdata still has tests which don't pass this flag, and so continue to test the kind-less (default) behavior. --- .../testdata/alias/fail_bool_value.carbon | 2 +- .../check/testdata/alias/fail_builtins.carbon | 4 +- .../testdata/alias/fail_control_flow.carbon | 6 +- .../alias/no_prelude/export_name.carbon | 2 +- .../fail_aliased_name_in_diag.carbon | 2 +- .../no_prelude/fail_local_in_namespace.carbon | 6 +- .../alias/no_prelude/fail_modifiers.carbon | 18 +-- .../no_prelude/fail_name_conflict.carbon | 8 +- .../alias/no_prelude/fail_not_constant.carbon | 2 +- .../alias/no_prelude/fail_params.carbon | 4 +- .../testdata/alias/no_prelude/import.carbon | 4 +- .../alias/no_prelude/import_access.carbon | 4 +- .../testdata/array/fail_bound_negative.carbon | 2 +- .../testdata/array/fail_bound_overflow.carbon | 8 +- .../array/fail_incomplete_element.carbon | 4 +- .../testdata/array/fail_invalid_type.carbon | 4 +- .../testdata/array/fail_out_of_bound.carbon | 2 +- .../fail_out_of_bound_non_literal.carbon | 2 +- .../testdata/array/fail_type_mismatch.carbon | 12 +- .../array/fail_undefined_bound.carbon | 2 +- .../testdata/as/adapter_conversion.carbon | 6 +- .../testdata/as/fail_no_conversion.carbon | 4 +- .../check/testdata/as/fail_not_type.carbon | 4 +- .../check/testdata/basics/fail_bad_run.carbon | 4 +- .../testdata/basics/fail_bad_run_2.carbon | 2 +- .../basics/fail_non_type_as_type.carbon | 4 +- .../fail_numeric_literal_overflow.carbon | 10 +- .../basics/fail_qualifier_unsupported.carbon | 2 +- .../basics/no_prelude/fail_name_lookup.carbon | 2 +- .../testdata/basics/type_literals.carbon | 26 ++--- .../check/testdata/builtins/float/add.carbon | 6 +- .../check/testdata/builtins/float/div.carbon | 6 +- .../check/testdata/builtins/float/eq.carbon | 2 +- .../testdata/builtins/float/make_type.carbon | 4 +- .../check/testdata/builtins/float/mul.carbon | 6 +- .../testdata/builtins/float/negate.carbon | 18 +-- .../check/testdata/builtins/float/neq.carbon | 2 +- .../check/testdata/builtins/float/sub.carbon | 6 +- .../check/testdata/builtins/int/eq.carbon | 2 +- .../testdata/builtins/int/left_shift.carbon | 10 +- .../builtins/int/make_type_signed.carbon | 6 +- .../builtins/int/make_type_unsigned.carbon | 6 +- .../testdata/builtins/int/right_shift.carbon | 6 +- .../check/testdata/builtins/int/sadd.carbon | 18 +-- .../check/testdata/builtins/int/sdiv.carbon | 6 +- .../check/testdata/builtins/int/smod.carbon | 6 +- .../check/testdata/builtins/int/smul.carbon | 2 +- .../testdata/builtins/int/snegate.carbon | 30 ++--- .../check/testdata/builtins/int/ssub.carbon | 2 +- .../check/testdata/builtins/int/uadd.carbon | 16 +-- .../check/testdata/builtins/int/udiv.carbon | 4 +- .../check/testdata/builtins/int/umod.carbon | 4 +- .../testdata/builtins/int/unegate.carbon | 28 ++--- .../testdata/class/access_modifers.carbon | 28 ++--- toolchain/check/testdata/class/adapt.carbon | 2 +- .../class/cross_package_import.carbon | 26 ++--- .../check/testdata/class/extend_adapt.carbon | 12 +- .../check/testdata/class/fail_abstract.carbon | 26 ++--- .../testdata/class/fail_adapt_bad_decl.carbon | 24 ++-- .../testdata/class/fail_adapt_bad_type.carbon | 4 +- .../class/fail_adapt_modifiers.carbon | 14 +-- .../class/fail_adapt_with_base.carbon | 4 +- .../class/fail_adapt_with_subobjects.carbon | 16 +-- .../testdata/class/fail_addr_not_self.carbon | 4 +- .../testdata/class/fail_addr_self.carbon | 6 +- .../class/fail_base_as_declared_name.carbon | 4 +- .../testdata/class/fail_base_bad_type.carbon | 50 ++++---- .../class/fail_base_method_define.carbon | 4 +- .../testdata/class/fail_base_misplaced.carbon | 6 +- .../testdata/class/fail_base_modifiers.carbon | 14 +-- .../testdata/class/fail_base_no_extend.carbon | 2 +- .../testdata/class/fail_base_repeated.carbon | 8 +- .../testdata/class/fail_base_unbound.carbon | 2 +- .../class/fail_compound_type_mismatch.carbon | 4 +- .../class/fail_convert_to_invalid.carbon | 2 +- .../class/fail_derived_to_base.carbon | 8 +- .../testdata/class/fail_extend_cycle.carbon | 6 +- .../class/fail_field_modifiers.carbon | 8 +- .../testdata/class/fail_generic_method.carbon | 8 +- .../testdata/class/fail_import_misuses.carbon | 12 +- .../testdata/class/fail_incomplete.carbon | 50 ++++---- .../check/testdata/class/fail_init.carbon | 6 +- .../class/fail_init_as_inplace.carbon | 2 +- .../class/fail_memaccess_category.carbon | 8 +- .../testdata/class/fail_member_of_let.carbon | 4 +- .../check/testdata/class/fail_method.carbon | 12 +- .../class/fail_method_modifiers.carbon | 16 +-- .../class/fail_method_redefinition.carbon | 4 +- .../testdata/class/fail_modifiers.carbon | 36 +++--- .../class/fail_out_of_line_decl.carbon | 2 +- .../class/fail_redeclaration_scope.carbon | 2 +- .../testdata/class/fail_redefinition.carbon | 10 +- .../check/testdata/class/fail_scope.carbon | 2 +- .../check/testdata/class/fail_self.carbon | 14 +-- .../testdata/class/fail_self_param.carbon | 2 +- .../class/fail_self_type_member.carbon | 4 +- .../class/fail_todo_local_class.carbon | 4 +- .../testdata/class/fail_unbound_field.carbon | 4 +- .../testdata/class/fail_unknown_member.carbon | 2 +- .../check/testdata/class/generic/call.carbon | 14 +-- .../testdata/class/generic/import.carbon | 12 +- .../class/generic/member_access.carbon | 4 +- .../class/generic/member_inline.carbon | 2 +- .../class/generic/member_out_of_line.carbon | 16 +-- .../testdata/class/generic/redeclare.carbon | 20 ++-- .../testdata/class/inheritance_access.carbon | 24 ++-- .../check/testdata/class/init_adapt.carbon | 16 +-- .../testdata/class/no_prelude/extern.carbon | 94 +++++++-------- .../class/no_prelude/extern_library.carbon | 2 +- .../class/no_prelude/generic_vs_params.carbon | 4 +- .../class/no_prelude/implicit_import.carbon | 18 +-- .../class/no_prelude/import_access.carbon | 12 +- .../no_definition_in_impl_file.carbon | 4 +- .../class/no_prelude/syntactic_merge.carbon | 26 ++--- toolchain/check/testdata/class/self.carbon | 8 +- .../class/syntactic_merge_literal.carbon | 6 +- .../testdata/class/virtual_modifiers.carbon | 2 +- .../check/testdata/const/collapse.carbon | 2 +- .../check/testdata/const/fail_collapse.carbon | 6 +- toolchain/check/testdata/deduce/array.carbon | 12 +- .../check/testdata/deduce/int_float.carbon | 2 +- toolchain/check/testdata/deduce/tuple.carbon | 4 +- .../testdata/deduce/type_operator.carbon | 4 +- .../check/testdata/eval/fail_aggregate.carbon | 2 +- .../check/testdata/eval/fail_symbolic.carbon | 2 +- .../function/builtin/fail_redefined.carbon | 12 +- .../function/builtin/fail_unknown.carbon | 2 +- .../function/call/fail_not_callable.carbon | 2 +- .../function/call/fail_param_count.carbon | 24 ++-- .../function/call/fail_param_type.carbon | 6 +- .../call/fail_return_type_mismatch.carbon | 4 +- .../fail_explicit_self_param.carbon | 2 +- .../fail_runtime_implicit_param.carbon | 2 +- .../declaration/fail_param_in_type.carbon | 2 +- .../declaration/fail_param_redecl.carbon | 4 +- .../function/declaration/import.carbon | 110 +++++++++--------- .../declaration/no_prelude/extern.carbon | 12 +- .../no_prelude/extern_library.carbon | 36 +++--- .../extern_library_for_default.carbon | 6 +- .../extern_library_from_default.carbon | 6 +- .../fail_import_incomplete_return.carbon | 32 ++--- .../no_prelude/fail_modifiers.carbon | 38 +++--- .../fail_pattern_in_signature.carbon | 4 +- .../declaration/no_prelude/fail_redecl.carbon | 20 ++-- .../no_prelude/fail_todo_no_params.carbon | 8 +- .../no_prelude/implicit_import.carbon | 14 +-- .../no_definition_in_impl_file.carbon | 4 +- .../function/definition/import.carbon | 30 ++--- .../function/definition/import_access.carbon | 12 +- .../definition/no_prelude/extern.carbon | 22 ++-- .../no_prelude/extern_library.carbon | 10 +- .../fail_decl_param_mismatch.carbon | 22 ++-- .../definition/no_prelude/fail_redef.carbon | 4 +- .../no_prelude/implicit_import.carbon | 30 ++--- .../no_prelude/syntactic_merge.carbon | 22 ++-- .../testdata/function/generic/deduce.carbon | 16 +-- .../generic/fail_todo_param_in_type.carbon | 2 +- .../fail_type_param_mismatch.carbon | 2 +- .../function/generic/redeclare.carbon | 24 ++-- .../function/generic/resolve_used.carbon | 2 +- .../function/generic/undefined.carbon | 4 +- .../if/fail_reachable_fallthrough.carbon | 6 +- toolchain/check/testdata/if/fail_scope.carbon | 2 +- .../if_expr/fail_not_in_function.carbon | 12 +- .../if_expr/fail_partial_constant.carbon | 6 +- .../testdata/impl/fail_call_invalid.carbon | 2 +- .../impl/fail_extend_impl_forall.carbon | 2 +- .../impl/fail_extend_impl_scope.carbon | 2 +- .../impl/fail_extend_impl_type_as.carbon | 10 +- .../impl/fail_extend_non_interface.carbon | 2 +- ..._extend_partially_defined_interface.carbon | 4 +- .../fail_extend_undefined_interface.carbon | 4 +- .../testdata/impl/fail_impl_as_scope.carbon | 2 +- .../impl/fail_impl_bad_assoc_const.carbon | 2 +- .../impl/fail_impl_bad_assoc_fn.carbon | 60 +++++----- .../impl/fail_impl_bad_interface.carbon | 6 +- .../testdata/impl/fail_redefinition.carbon | 4 +- .../impl/fail_todo_impl_assoc_const.carbon | 6 +- .../lookup/fail_alias_impl_not_found.carbon | 4 +- .../lookup/fail_todo_undefined_impl.carbon | 2 +- .../check/testdata/impl/lookup/generic.carbon | 4 +- .../impl/no_prelude/fail_alias.carbon | 4 +- .../impl/no_prelude/fail_impl_bad_type.carbon | 2 +- .../no_prelude/generic_redeclaration.carbon | 4 +- .../impl/no_prelude/import_generic.carbon | 6 +- .../impl/no_prelude/interface_args.carbon | 4 +- .../no_definition_in_impl_file.carbon | 4 +- .../index/fail_array_large_index.carbon | 4 +- .../index/fail_array_non_int_indexing.carbon | 4 +- .../fail_array_out_of_bound_access.carbon | 2 +- .../testdata/index/fail_expr_category.carbon | 8 +- .../testdata/index/fail_invalid_base.carbon | 8 +- .../testdata/index/fail_name_not_found.carbon | 2 +- .../index/fail_negative_indexing.carbon | 2 +- .../index/fail_non_tuple_access.carbon | 2 +- .../fail_assoc_const_bad_default.carbon | 4 +- .../fail_todo_assoc_const_default.carbon | 4 +- .../fail_todo_define_default_fn_inline.carbon | 4 +- ..._todo_define_default_fn_out_of_line.carbon | 12 +- .../fail_add_member_outside_definition.carbon | 6 +- .../fail_assoc_const_not_binding.carbon | 2 +- .../fail_assoc_const_not_constant.carbon | 4 +- .../fail_assoc_const_template.carbon | 2 +- .../fail_definition_imported.carbon | 6 +- .../no_prelude/fail_duplicate.carbon | 16 +-- .../fail_generic_redeclaration.carbon | 12 +- .../no_prelude/fail_lookup_undefined.carbon | 16 +-- .../no_prelude/fail_member_lookup.carbon | 4 +- .../no_prelude/fail_modifiers.carbon | 8 +- .../no_prelude/fail_redeclare_member.carbon | 4 +- .../no_prelude/fail_todo_facet_lookup.carbon | 4 +- .../fail_todo_generic_default_fn.carbon | 4 +- .../no_prelude/fail_todo_modifiers.carbon | 4 +- .../interface/no_prelude/generic.carbon | 4 +- .../no_prelude/generic_vs_params.carbon | 4 +- .../interface/no_prelude/import_access.carbon | 14 +-- .../no_prelude/syntactic_merge.carbon | 40 +++---- .../testdata/let/compile_time_bindings.carbon | 26 ++--- .../testdata/let/fail_duplicate_decl.carbon | 4 +- .../check/testdata/let/fail_generic.carbon | 8 +- .../testdata/let/fail_generic_import.carbon | 4 +- .../testdata/let/fail_missing_value.carbon | 4 +- .../check/testdata/let/fail_modifiers.carbon | 32 ++--- .../testdata/let/fail_use_in_init.carbon | 2 +- .../check/testdata/let/generic_import.carbon | 6 +- .../let/no_prelude/import_access.carbon | 4 +- .../fail_conflict_after_merge.carbon | 12 +- ...l_conflict_imported_namespace_first.carbon | 6 +- ..._conflict_imported_namespace_nested.carbon | 10 +- ..._conflict_imported_namespace_second.carbon | 12 +- ...conflict_in_imports_namespace_first.carbon | 8 +- ...onflict_in_imports_namespace_second.carbon | 8 +- .../namespace/fail_decl_in_alias.carbon | 4 +- .../testdata/namespace/fail_duplicate.carbon | 4 +- .../testdata/namespace/fail_modifiers.carbon | 22 ++-- .../testdata/namespace/fail_params.carbon | 10 +- .../namespace/fail_unresolved_scope.carbon | 2 +- .../fail_and_or_not_in_function.carbon | 12 +- .../fail_and_or_partial_constant.carbon | 8 +- .../builtin/fail_assignment_to_error.carbon | 4 +- .../fail_assignment_to_non_assignable.carbon | 16 +-- .../fail_redundant_compound_access.carbon | 4 +- .../builtin/fail_type_mismatch.carbon | 4 +- .../fail_type_mismatch_assignment.carbon | 4 +- .../builtin/fail_type_mismatch_once.carbon | 4 +- .../builtin/fail_unimplemented_op.carbon | 2 +- .../testdata/operators/overloaded/eq.carbon | 12 +- .../overloaded/fail_assign_non_ref.carbon | 8 +- .../operators/overloaded/fail_no_impl.carbon | 8 +- .../overloaded/fail_no_impl_for_arg.carbon | 12 +- .../operators/overloaded/ordered.carbon | 8 +- .../package_expr/fail_not_found.carbon | 2 +- .../packages/fail_api_not_found.carbon | 6 +- .../fail_conflict_no_namespaces.carbon | 8 +- .../check/testdata/packages/fail_cycle.carbon | 10 +- .../packages/fail_duplicate_api.carbon | 8 +- .../testdata/packages/fail_extension.carbon | 26 ++--- .../packages/fail_import_default.carbon | 8 +- .../packages/fail_import_invalid.carbon | 18 +-- .../packages/fail_import_repeat.carbon | 16 +-- .../packages/fail_import_type_error.carbon | 8 +- .../fail_name_with_import_failure.carbon | 2 +- .../packages/fail_package_main.carbon | 8 +- .../no_prelude/cross_package_export.carbon | 22 ++-- .../no_prelude/cross_package_import.carbon | 46 ++++---- .../packages/no_prelude/export_import.carbon | 4 +- .../packages/no_prelude/export_mixed.carbon | 2 +- .../packages/no_prelude/export_name.carbon | 26 ++--- .../no_prelude/fail_export_name_member.carbon | 6 +- .../no_prelude/fail_export_name_params.carbon | 2 +- .../packages/no_prelude/fail_modifiers.carbon | 30 ++--- .../implicit_imports_entities.carbon | 16 +-- .../no_prelude/missing_prelude.carbon | 6 +- .../pointer/fail_address_of_error.carbon | 6 +- .../pointer/fail_address_of_value.carbon | 28 ++--- .../testdata/pointer/fail_deref_error.carbon | 4 +- .../pointer/fail_deref_function.carbon | 4 +- .../pointer/fail_deref_namespace.carbon | 4 +- .../pointer/fail_deref_not_pointer.carbon | 12 +- .../testdata/pointer/fail_deref_type.carbon | 6 +- .../pointer/fail_type_mismatch.carbon | 4 +- .../testdata/return/fail_call_in_type.carbon | 2 +- .../testdata/return/fail_error_in_type.carbon | 2 +- .../testdata/return/fail_let_in_type.carbon | 10 +- .../return/fail_missing_return.carbon | 2 +- .../fail_missing_return_empty_tuple.carbon | 2 +- .../fail_return_var_no_returned_var.carbon | 2 +- .../fail_return_with_returned_var.carbon | 8 +- .../fail_returned_var_no_return_type.carbon | 4 +- .../return/fail_returned_var_shadow.carbon | 8 +- .../return/fail_returned_var_type.carbon | 4 +- .../testdata/return/fail_type_mismatch.carbon | 4 +- .../return/fail_value_disallowed.carbon | 4 +- .../testdata/return/fail_value_missing.carbon | 4 +- .../testdata/return/fail_var_in_type.carbon | 2 +- .../struct/fail_access_into_invalid.carbon | 2 +- .../testdata/struct/fail_assign_empty.carbon | 2 +- .../struct/fail_assign_to_empty.carbon | 2 +- .../struct/fail_duplicate_name.carbon | 20 ++-- .../struct/fail_field_name_mismatch.carbon | 4 +- .../struct/fail_field_type_mismatch.carbon | 2 +- .../testdata/struct/fail_keyword_name.carbon | 6 +- .../struct/fail_member_access_type.carbon | 2 +- .../struct/fail_member_of_function.carbon | 2 +- .../struct/fail_non_member_access.carbon | 2 +- .../struct/fail_too_few_values.carbon | 2 +- .../testdata/struct/fail_type_assign.carbon | 4 +- .../testdata/struct/fail_value_as_type.carbon | 4 +- toolchain/check/testdata/struct/import.carbon | 10 +- .../no_prelude/fail_assign_nested.carbon | 2 +- .../no_prelude/fail_nested_incomplete.carbon | 4 +- .../tuple/access/fail_access_error.carbon | 2 +- .../tuple/access/fail_empty_access.carbon | 2 +- .../tuple/access/fail_large_index.carbon | 4 +- .../access/fail_negative_indexing.carbon | 2 +- .../access/fail_non_deterministic_type.carbon | 2 +- .../tuple/access/fail_non_int_indexing.carbon | 4 +- .../tuple/access/fail_non_tuple_access.carbon | 4 +- .../access/fail_out_of_bound_access.carbon | 2 +- .../fail_out_of_bound_not_literal.carbon | 2 +- .../testdata/tuple/fail_assign_nested.carbon | 2 +- .../tuple/fail_element_type_mismatch.carbon | 4 +- .../tuple/fail_nested_incomplete.carbon | 4 +- .../tuple/fail_too_few_element.carbon | 2 +- .../testdata/tuple/fail_type_assign.carbon | 4 +- .../testdata/tuple/fail_value_as_type.carbon | 4 +- toolchain/check/testdata/tuple/import.carbon | 10 +- .../tuple/no_prelude/fail_assign_empty.carbon | 2 +- .../no_prelude/fail_assign_to_empty.carbon | 2 +- .../testdata/var/fail_not_copyable.carbon | 4 +- .../var/fail_storage_is_literal.carbon | 4 +- .../var/fail_todo_control_flow_init.carbon | 20 ++-- .../var/no_prelude/export_name.carbon | 6 +- .../var/no_prelude/fail_duplicate_decl.carbon | 4 +- .../var/no_prelude/fail_generic.carbon | 2 +- .../no_prelude/fail_init_type_mismatch.carbon | 2 +- .../var/no_prelude/fail_init_with_self.carbon | 2 +- .../fail_lookup_outside_scope.carbon | 2 +- .../var/no_prelude/fail_modifiers.carbon | 14 +-- .../no_prelude/fail_namespace_conflict.carbon | 8 +- .../var/no_prelude/import_access.carbon | 4 +- .../testdata/where_expr/constraints.carbon | 36 +++--- .../testdata/where_expr/designator.carbon | 14 +-- .../testdata/where_expr/fail_not_facet.carbon | 2 +- .../testdata/while/fail_bad_condition.carbon | 4 +- .../testdata/while/fail_break_continue.carbon | 8 +- toolchain/diagnostics/diagnostic_consumer.cpp | 15 ++- toolchain/diagnostics/diagnostic_consumer.h | 9 +- toolchain/driver/compile_subcommand.cpp | 12 +- toolchain/driver/compile_subcommand.h | 1 + toolchain/driver/format_subcommand.cpp | 3 +- .../fail_bad_comment_introducers.carbon | 10 +- ...introducers_mid_block_indent_change.carbon | 6 +- .../testdata/fail_bad_raw_identifier.carbon | 16 +-- .../fail_block_string_second_line.carbon | 2 +- .../testdata/fail_mismatched_brackets.carbon | 6 +- .../fail_mismatched_brackets_2.carbon | 2 +- toolchain/lex/testdata/fail_multifile.carbon | 4 +- .../testdata/fail_trailing_comments.carbon | 6 +- toolchain/lex/tokenized_buffer_benchmark.cpp | 2 +- .../basics/fail_before_lowering.carbon | 4 +- .../parse/testdata/alias/fail_syntax.carbon | 22 ++-- .../array/fail_require_close_bracket.carbon | 4 +- .../testdata/array/fail_require_semi.carbon | 2 +- .../parse/testdata/array/fail_syntax.carbon | 26 ++--- .../basics/fail_bracket_recovery.carbon | 8 +- .../basics/fail_invalid_designators.carbon | 4 +- .../basics/fail_modifiers_before_semi.carbon | 2 +- .../basics/fail_no_intro_with_semi.carbon | 2 +- .../basics/fail_no_intro_without_semi.carbon | 2 +- .../basics/fail_paren_match_regression.carbon | 6 +- ...il_alternative_with_implicit_params.carbon | 2 +- ...fail_invalid_alternative_identifier.carbon | 4 +- .../choice/fail_invalid_braces.carbon | 4 +- .../choice/fail_missing_definition.carbon | 2 +- ...il_missing_definition_parameterized.carbon | 2 +- .../fail_qualified_alternative_name.carbon | 2 +- toolchain/parse/testdata/class/adapt.carbon | 10 +- .../parse/testdata/class/fail_base.carbon | 8 +- .../testdata/class/fail_base_misplaced.carbon | 2 +- .../testdata/class/fail_modifiers.carbon | 6 +- .../for/fail_colon_instead_of_in.carbon | 2 +- .../testdata/for/fail_missing_cond.carbon | 8 +- .../parse/testdata/for/fail_missing_in.carbon | 2 +- .../testdata/for/fail_missing_var.carbon | 2 +- .../testdata/for/fail_returned_var.carbon | 2 +- .../testdata/for/fail_square_brackets.carbon | 8 +- .../function/declaration/extern.carbon | 6 +- .../fail_identifier_instead_of_sig.carbon | 2 +- .../fail_missing_implicit_close.carbon | 4 +- .../declaration/fail_missing_name.carbon | 2 +- .../declaration/fail_no_sig_or_semi.carbon | 2 +- .../declaration/fail_only_fn_and_semi.carbon | 2 +- .../fail_repeated_fn_and_semi.carbon | 2 +- ...skip_indented_newline_until_outdent.carbon | 2 +- ...ail_skip_indented_newline_with_semi.carbon | 2 +- ..._skip_indented_newline_without_semi.carbon | 2 +- .../fail_skip_to_newline_without_semi.carbon | 2 +- .../fail_skip_without_semi_to_curly.carbon | 2 +- .../fail_with_identifier_as_param.carbon | 2 +- ...hout_name_and_many_tokens_in_params.carbon | 2 +- .../function/definition/fail_builtin.carbon | 6 +- .../fail_identifier_in_statements.carbon | 2 +- .../deduced_params/fail_no_parens.carbon | 8 +- .../testdata/generics/impl/fail_impl.carbon | 32 ++--- .../impl/fail_out_of_line_member.carbon | 4 +- .../interface/fail_missing_name.carbon | 2 +- .../interface/fail_missing_open_curly.carbon | 4 +- .../interface/fail_self_param_syntax.carbon | 4 +- .../named_constraint/fail_incomplete.carbon | 4 +- .../testdata/if/fail_else_unbraced.carbon | 8 +- .../parse/testdata/if/fail_errors.carbon | 10 +- .../testdata/if/fail_missing_cond.carbon | 2 +- .../testdata/if/fail_square_brackets.carbon | 6 +- .../parse/testdata/if/fail_unbraced.carbon | 6 +- .../if_expr/fail_condition_missing.carbon | 2 +- .../if_expr/fail_else_expr_missing.carbon | 2 +- .../testdata/if_expr/fail_else_missing.carbon | 2 +- .../if_expr/fail_then_expr_missing.carbon | 2 +- .../testdata/if_expr/fail_then_missing.carbon | 2 +- .../testdata/if_expr/fail_top_level_if.carbon | 6 +- .../testdata/index/fail_empty_expr.carbon | 2 +- .../testdata/index/fail_malformed_expr.carbon | 2 +- .../parse/testdata/let/fail_bad_name.carbon | 2 +- .../parse/testdata/let/fail_empty.carbon | 2 +- .../testdata/let/fail_missing_name.carbon | 4 +- .../testdata/let/fail_missing_type.carbon | 2 +- .../parse/testdata/let/fail_no_semi.carbon | 4 +- .../match/fail_cases_after_default.carbon | 6 +- .../match/fail_missing_case_arrow.carbon | 4 +- .../match/fail_missing_case_pattern.carbon | 2 +- .../fail_missing_case_statements_block.carbon | 2 +- .../testdata/match/fail_missing_cases.carbon | 2 +- .../match/fail_missing_cases_block.carbon | 2 +- .../match/fail_missing_default_arrow.carbon | 2 +- ...il_missing_default_statements_block.carbon | 2 +- .../fail_missing_guard_close_paren.carbon | 4 +- .../fail_missing_guard_open_paren.carbon | 4 +- .../match/fail_missing_matched_expr.carbon | 2 +- ...il_unexpected_tokens_in_cases_block.carbon | 12 +- .../member_access/fail_keyword.carbon | 12 +- .../testdata/namespace/fail_arrow.carbon | 2 +- .../testdata/namespace/fail_incomplete.carbon | 12 +- .../namespace/fail_incomplete_name.carbon | 2 +- .../testdata/namespace/fail_modifiers.carbon | 4 +- .../testdata/namespace/fail_no_name.carbon | 2 +- .../operators/fail_chained_assign.carbon | 2 +- .../fail_infix_uneven_space_after.carbon | 2 +- .../fail_infix_uneven_space_before.carbon | 2 +- .../operators/fail_invalid_infix.carbon | 8 +- .../operators/fail_postfix_space.carbon | 2 +- .../fail_postfix_space_before_comma.carbon | 2 +- .../fail_postfix_space_in_call.carbon | 2 +- .../fail_postfix_space_surrounding.carbon | 2 +- .../operators/fail_postincrement.carbon | 4 +- .../operators/fail_precedence_and_or.carbon | 2 +- .../operators/fail_precedence_as.carbon | 14 +-- .../operators/fail_precedence_assign.carbon | 10 +- .../operators/fail_precedence_or_and.carbon | 2 +- .../operators/fail_precedence_where.carbon | 18 +-- .../operators/fail_prefix_repeat.carbon | 2 +- .../operators/fail_prefix_space.carbon | 2 +- ...ail_prefix_uneven_space_with_assign.carbon | 2 +- .../testdata/operators/fail_star_minus.carbon | 2 +- .../testdata/operators/fail_star_star.carbon | 2 +- .../operators/fail_star_star_no_space.carbon | 2 +- .../testdata/operators/fail_variety.carbon | 10 +- .../testdata/package_expr/fail_in_name.carbon | 6 +- .../parse/testdata/packages/export.carbon | 22 ++-- .../testdata/packages/import/export.carbon | 10 +- .../packages/import/fail_after_decl.carbon | 4 +- .../import/fail_after_decl_repeated.carbon | 12 +- .../packages/import/fail_extra_string.carbon | 2 +- .../import/fail_library_is_identifier.carbon | 2 +- .../import/fail_name_is_keyword.carbon | 2 +- .../packages/import/fail_no_name.carbon | 2 +- .../packages/import/fail_no_semi.carbon | 2 +- .../import/fail_omit_library_keyword.carbon | 2 +- .../testdata/packages/import/fail_type.carbon | 2 +- .../packages/library/fail_invalid_name.carbon | 12 +- .../packages/library/fail_semi_before.carbon | 4 +- .../packages/library/fail_too_late.carbon | 4 +- .../packages/package/fail_after_decl.carbon | 4 +- .../packages/package/fail_after_import.carbon | 4 +- .../package/fail_after_package.carbon | 4 +- .../packages/package/fail_extra_string.carbon | 2 +- .../package/fail_library_is_identifier.carbon | 2 +- .../package/fail_library_skips_name.carbon | 2 +- .../package/fail_name_is_keyword.carbon | 2 +- .../packages/package/fail_no_name.carbon | 2 +- .../packages/package/fail_no_semi.carbon | 2 +- .../package/fail_omit_library_keyword.carbon | 2 +- .../packages/package/fail_semi_before.carbon | 4 +- .../package/fail_trailing_impl.carbon | 2 +- .../pointer/fail_pointer_type_in_expr.carbon | 2 +- ...e_instead_of_compound_member_access.carbon | 16 +-- .../testdata/return/fail_expr_no_semi.carbon | 2 +- .../parse/testdata/return/fail_no_semi.carbon | 4 +- .../return/fail_returned_no_var.carbon | 2 +- .../testdata/return/fail_var_no_semi.carbon | 2 +- .../testdata/struct/fail_comma_only.carbon | 2 +- .../struct/fail_comma_repeat_in_type.carbon | 2 +- .../struct/fail_comma_repeat_in_value.carbon | 2 +- .../struct/fail_extra_token_in_type.carbon | 2 +- .../struct/fail_extra_token_in_value.carbon | 2 +- .../struct/fail_identifier_colon.carbon | 2 +- .../struct/fail_identifier_equals.carbon | 2 +- .../struct/fail_identifier_only.carbon | 2 +- .../fail_invalid_struct_designator.carbon | 2 +- .../testdata/struct/fail_missing_type.carbon | 2 +- .../testdata/struct/fail_missing_value.carbon | 2 +- .../struct/fail_mix_type_and_value.carbon | 2 +- .../struct/fail_mix_value_and_type.carbon | 2 +- .../struct/fail_mix_with_unknown.carbon | 8 +- .../struct/fail_no_colon_or_equals.carbon | 2 +- .../testdata/struct/fail_period_only.carbon | 2 +- .../testdata/struct/fail_period_paren.carbon | 2 +- .../struct/fail_period_string_colon.carbon | 2 +- .../struct/fail_period_string_equals.carbon | 2 +- .../struct/fail_type_no_designator.carbon | 2 +- .../parse/testdata/var/fail_bad_name.carbon | 2 +- .../parse/testdata/var/fail_empty.carbon | 2 +- .../parse/testdata/var/fail_no_semi.carbon | 4 +- .../testdata/where_expr/designators.carbon | 12 +- .../testdata/where_expr/fail_rewrite.carbon | 14 +-- .../testdata/where_expr/where_and.carbon | 6 +- .../testdata/while/fail_missing_cond.carbon | 2 +- .../parse/testdata/while/fail_no_semi.carbon | 4 +- .../parse/testdata/while/fail_unbraced.carbon | 2 +- toolchain/testing/file_test.cpp | 4 +- 530 files changed, 1951 insertions(+), 1931 deletions(-) diff --git a/toolchain/check/testdata/alias/fail_bool_value.carbon b/toolchain/check/testdata/alias/fail_bool_value.carbon index 84b1e63a3cbae..b8eb93c7181f8 100644 --- a/toolchain/check/testdata/alias/fail_bool_value.carbon +++ b/toolchain/check/testdata/alias/fail_bool_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_bool_value.carbon -// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference +// CHECK:STDERR: fail_bool_value.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference // CHECK:STDERR: alias a = false; // CHECK:STDERR: ^~~~~ alias a = false; diff --git a/toolchain/check/testdata/alias/fail_builtins.carbon b/toolchain/check/testdata/alias/fail_builtins.carbon index 5ca00d7e85c44..8183e3b92b66c 100644 --- a/toolchain/check/testdata/alias/fail_builtins.carbon +++ b/toolchain/check/testdata/alias/fail_builtins.carbon @@ -8,13 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_builtins.carbon -// CHECK:STDERR: fail_builtins.carbon:[[@LINE+4]]:11: error: alias initializer must be a name reference +// CHECK:STDERR: fail_builtins.carbon:[[@LINE+4]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference // CHECK:STDERR: alias a = i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: alias a = i32; -// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference +// CHECK:STDERR: fail_builtins.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference // CHECK:STDERR: alias b = bool; // CHECK:STDERR: ^~~~ alias b = bool; diff --git a/toolchain/check/testdata/alias/fail_control_flow.carbon b/toolchain/check/testdata/alias/fail_control_flow.carbon index 69ce51afd902d..4d26153abefff 100644 --- a/toolchain/check/testdata/alias/fail_control_flow.carbon +++ b/toolchain/check/testdata/alias/fail_control_flow.carbon @@ -8,15 +8,15 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/fail_control_flow.carbon -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+11]]:11: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+7]]:11: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: error: alias initializer must be a name reference +// CHECK:STDERR: fail_control_flow.carbon:[[@LINE+3]]:11: error(AliasRequiresNameRef): alias initializer must be a name reference // CHECK:STDERR: alias a = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ alias a = true or false; diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/no_prelude/export_name.carbon index 702f144bab9dd..a02e590161a38 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/no_prelude/export_name.carbon @@ -53,7 +53,7 @@ library "[[@TEST_NAME]]"; import library "export"; -// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+3]]:8: error: name `C` not found +// CHECK:STDERR: fail_orig_name_not_in_export.carbon:[[@LINE+3]]:8: error(NameNotFound): name `C` not found // CHECK:STDERR: var c: C = {}; // CHECK:STDERR: ^ var c: C = {}; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon index 613bf9c29ef7c..5c91662157575 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_aliased_name_in_diag.carbon @@ -14,7 +14,7 @@ class D {} alias c = C; var d: D = {}; -// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: error: package `Core` implicitly referenced here, but not found +// CHECK:STDERR: fail_aliased_name_in_diag.carbon:[[@LINE+3]]:1: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: let c_var: c = d; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ let c_var: c = d; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon index ab89323d530a3..36193cc0e8776 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_local_in_namespace.carbon @@ -11,16 +11,16 @@ namespace NS; fn F() -> {} { - // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+8]]:9: error: name `NS` not found + // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+8]]:9: error(NameNotFound): name `NS` not found // CHECK:STDERR: alias NS.a = {}; // CHECK:STDERR: ^~ // CHECK:STDERR: - // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: error: alias initializer must be a name reference + // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+4]]:16: error(AliasRequiresNameRef): alias initializer must be a name reference // CHECK:STDERR: alias NS.a = {}; // CHECK:STDERR: ^~ // CHECK:STDERR: alias NS.a = {}; - // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error: name `a` not found + // CHECK:STDERR: fail_local_in_namespace.carbon:[[@LINE+3]]:10: error(NameNotFound): name `a` not found // CHECK:STDERR: return NS.a; // CHECK:STDERR: ^~~~ return NS.a; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon index 07d20d5c192af..698d8dc460799 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_modifiers.carbon @@ -10,40 +10,40 @@ class Class {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:1: error: `abstract` not allowed on `alias` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:1: error(ModifierNotAllowedOnDeclaration): `abstract` not allowed on `alias` declaration // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: error: `base` not allowed on declaration with `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:10: error(ModifierNotAllowedWith): `base` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:15: error: `default` not allowed on declaration with `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:15: error(ModifierNotAllowedWith): `default` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:23: error: `final` not allowed on declaration with `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:23: error(ModifierNotAllowedWith): `final` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: abstract base default final alias A = Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract base default final alias A = Class; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `impl` not allowed on `alias` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `impl` not allowed on `alias` declaration // CHECK:STDERR: impl alias B = Class; // CHECK:STDERR: ^~~~ // CHECK:STDERR: impl alias B = Class; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `extern` not allowed on `alias` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error(ModifierNotAllowedOnDeclaration): `extern` not allowed on `alias` declaration // CHECK:STDERR: extern alias C = Class; // CHECK:STDERR: ^~~~~~ extern alias C = Class; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon index 071ccccdbb8ad..9bef098fbf412 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_name_conflict.carbon @@ -11,20 +11,20 @@ class C {} alias a = C; -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+7]]:5: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: var a: C = {}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: note: name is previously declared here +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:7: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: alias a = C; // CHECK:STDERR: ^ // CHECK:STDERR: var a: C = {}; var b: C = {}; -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE+6]]:7: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: alias b = C; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: note: name is previously declared here +// CHECK:STDERR: fail_name_conflict.carbon:[[@LINE-4]]:5: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: var b: C = {}; // CHECK:STDERR: ^ alias b = C; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon index 22aa1aecb416f..368df1473560f 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_not_constant.carbon @@ -11,7 +11,7 @@ fn F() { var a: () = (); var b: ()* = &a; - // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: error: alias initializer must be a name reference + // CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:13: error(AliasRequiresNameRef): alias initializer must be a name reference // CHECK:STDERR: alias c = *b; // CHECK:STDERR: ^~ alias c = *b; diff --git a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon index 35856017f2c13..dbef063018931 100644 --- a/toolchain/check/testdata/alias/no_prelude/fail_params.carbon +++ b/toolchain/check/testdata/alias/no_prelude/fail_params.carbon @@ -8,11 +8,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/fail_params.carbon -// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:8: error: `alias` declaration cannot have parameters +// CHECK:STDERR: fail_params.carbon:[[@LINE+7]]:8: error(UnexpectedDeclNameParams): `alias` declaration cannot have parameters // CHECK:STDERR: alias A(T:! type) = T*; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: error: alias initializer must be a name reference +// CHECK:STDERR: fail_params.carbon:[[@LINE+3]]:21: error(AliasRequiresNameRef): alias initializer must be a name reference // CHECK:STDERR: alias A(T:! type) = T*; // CHECK:STDERR: ^~ alias A(T:! type) = T*; diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/no_prelude/import.carbon index b075af6f00832..2b3e58144edf6 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import.carbon @@ -58,8 +58,8 @@ var b: () = a_alias; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_var3.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: var2.carbon:8:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` +// CHECK:STDERR: fail_var3.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: var2.carbon:8:5: error(SemanticsTodo): semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` // CHECK:STDERR: var b: () = a_alias; // CHECK:STDERR: ^ import library "var2"; diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index 1fc63d22f0f33..13484d753af23 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -35,7 +35,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:11: error: name `A` not found +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:11: error(NameNotFound): name `A` not found // CHECK:STDERR: var inst: A = {}; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -47,7 +47,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error: name `A` not found +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:11: error(NameNotFound): name `A` not found // CHECK:STDERR: var inst: Test.A = {}; // CHECK:STDERR: ^~~~~~ var inst: Test.A = {}; diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 31bfe9373e0e7..515644753ff07 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -10,7 +10,7 @@ fn Negate(n: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: error: array bound of -1 is negative +// CHECK:STDERR: fail_bound_negative.carbon:[[@LINE+3]]:14: error(ArrayBoundNegative): array bound of -1 is negative // CHECK:STDERR: var a: [i32; Negate(1)]; // CHECK:STDERR: ^~~~~~~ var a: [i32; Negate(1)]; diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index ce97fc3b0b792..3fef580b13d01 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -11,20 +11,20 @@ // TODO: Once we preserve the full value of integer literals in SemIR, check // that we reject the array bound being too large. -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 39999999999999999993 does not fit in i32 +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+4]]:14: error(IntLiteralTooLargeForI32): integer literal with value 39999999999999999993 does not fit in i32 // CHECK:STDERR: var a: [i32; 39999999999999999993]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var a: [i32; 39999999999999999993]; -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+10]]:9: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+7]]:9: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: error: integer literal with value 39999999999999999993 does not fit in i32 +// CHECK:STDERR: fail_bound_overflow.carbon:[[@LINE+3]]:12: error(IntLiteralTooLargeForI32): integer literal with value 39999999999999999993 does not fit in i32 // CHECK:STDERR: var b: [1; 39999999999999999993]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ var b: [1; 39999999999999999993]; diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index cf5ed6ea984cd..299a46199c2a1 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -10,10 +10,10 @@ class Incomplete; -// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error: variable has incomplete type `[Incomplete; 1]` +// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE+6]]:8: error(IncompleteTypeInVarDecl): variable has incomplete type `[Incomplete; 1]` // CHECK:STDERR: var a: [Incomplete; 1]; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: note: class was forward declared here +// CHECK:STDERR: fail_incomplete_element.carbon:[[@LINE-5]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var a: [Incomplete; 1]; diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 5b6b1aa2a69f7..7e3f6e1c5c022 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_invalid_type.carbon -// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+6]]:9: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_invalid_type.carbon:[[@LINE+3]]:9: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: [1; 1]; // CHECK:STDERR: ^ var a: [1; 1]; diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index 3bce7d61fe46e..b8ff16e4c4dd5 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound.carbon -// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: error: cannot initialize array of 1 element from 3 initializers +// CHECK:STDERR: fail_out_of_bound.carbon:[[@LINE+3]]:19: error(ArrayInitFromLiteralArgCountMismatch): cannot initialize array of 1 element from 3 initializers // CHECK:STDERR: var a: [i32; 1] = (1, 2, 3); // CHECK:STDERR: ^~~~~~~~~ var a: [i32; 1] = (1, 2, 3); diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index 58045ba0389fb..1080b4c835ee0 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon var a: [i32; 3] = (1, 2, 3); -// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: error: array index `3` is past the end of type `[i32; 3]` +// CHECK:STDERR: fail_out_of_bound_non_literal.carbon:[[@LINE+3]]:16: error(ArrayIndexOutOfBounds): array index `3` is past the end of type `[i32; 3]` // CHECK:STDERR: var b: i32 = a[{.index = 3}.index]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ var b: i32 = a[{.index = 3}.index]; diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 1309cf63e1c97..c34d2755ee168 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -8,33 +8,33 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_type_mismatch.carbon -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error(ImplicitAsConversionFailure): cannot implicitly convert from `String` to `i32` // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note(MissingImplInMemberAccessNote): type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var a: [i32; 3] = (1, "Hello", "World"); var t1: (i32, String, String); -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error: cannot implicitly convert from `String` to `i32` +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:19: error(ImplicitAsConversionFailure): cannot implicitly convert from `String` to `i32` // CHECK:STDERR: var b: [i32; 3] = t1; // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note: type `String` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: note(MissingImplInMemberAccessNote): type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: [i32; 3] = t1; // CHECK:STDERR: ^~ // CHECK:STDERR: var b: [i32; 3] = t1; -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: error: cannot initialize array of 3 elements from 2 initializers +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:19: error(ArrayInitFromLiteralArgCountMismatch): cannot initialize array of 3 elements from 2 initializers // CHECK:STDERR: var c: [i32; 3] = (1, 2); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: var c: [i32; 3] = (1, 2); var t2: (i32, i32); -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: error: cannot initialize array of 3 elements from tuple with 2 elements +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:19: error(ArrayInitFromExprArgCountMismatch): cannot initialize array of 3 elements from tuple with 2 elements // CHECK:STDERR: var d: [i32; 3] = t2; // CHECK:STDERR: ^~ var d: [i32; 3] = t2; diff --git a/toolchain/check/testdata/array/fail_undefined_bound.carbon b/toolchain/check/testdata/array/fail_undefined_bound.carbon index 6c071fe92485a..f65670d51ad0c 100644 --- a/toolchain/check/testdata/array/fail_undefined_bound.carbon +++ b/toolchain/check/testdata/array/fail_undefined_bound.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/fail_undefined_bound.carbon -// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: error: semantics TODO: `HandleArrayExprWithoutBounds` +// CHECK:STDERR: fail_undefined_bound.carbon:[[@LINE+3]]:8: error(SemanticsTodo): semantics TODO: `HandleArrayExprWithoutBounds` // CHECK:STDERR: var a: [i32; ]; // CHECK:STDERR: ^~~~~~~ var a: [i32; ]; diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index ec079596418ba..3a80e66a4c5e9 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -76,7 +76,7 @@ let b_value: B = ({.x = 1, .y = 2} as A) as B; // a copy to perform initialization. It's not clear whether that is the right // behavior. -// CHECK:STDERR: fail_init_class.carbon:[[@LINE+4]]:17: error: cannot copy value of type `B` +// CHECK:STDERR: fail_init_class.carbon:[[@LINE+4]]:17: error(CopyOfUncopyableType): cannot copy value of type `B` // CHECK:STDERR: var b_init: B = ({.x = 1, .y = 2} as A) as B; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -97,10 +97,10 @@ class B { // We do not try to implicitly convert from the first operand of `as` to the // adapted type of the second operand. -// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+6]]:12: error: cannot convert from `{.x: i32}` to `B` with `as` +// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+6]]:12: error(ExplicitAsConversionFailure): cannot convert from `{.x: i32}` to `B` with `as` // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: note: type `{.x: i32}` does not implement interface `As` +// CHECK:STDERR: fail_adapt_init_from_struct.carbon:[[@LINE+3]]:12: note(MissingImplInMemberAccessNote): type `{.x: i32}` does not implement interface `As` // CHECK:STDERR: var b: B = {.x = 1} as B; // CHECK:STDERR: ^~~~~~~~~~~~~ var b: B = {.x = 1} as B; diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index 1d0e0e68eba65..f36c01b1e0102 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/as/fail_no_conversion.carbon -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:21: error: cannot convert from `i32` to `(i32, i32)` with `as` +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:21: error(ExplicitAsConversionFailure): cannot convert from `i32` to `(i32, i32)` with `as` // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: note: type `i32` does not implement interface `As` +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+3]]:21: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `As` // CHECK:STDERR: let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~ let n: (i32, i32) = 1 as (i32, i32); diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 1056b66e9e787..14697aedcf8da 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/as/fail_not_type.carbon -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+6]]:19: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+6]]:19: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+3]]:19: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let n: i32 = 1 as 2; // CHECK:STDERR: ^ let n: i32 = 1 as 2; diff --git a/toolchain/check/testdata/basics/fail_bad_run.carbon b/toolchain/check/testdata/basics/fail_bad_run.carbon index 9c2c62fbe669a..72b05bac5e9c7 100644 --- a/toolchain/check/testdata/basics/fail_bad_run.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run.carbon @@ -8,11 +8,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_bad_run.carbon -// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+7]]:1: error: invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` +// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+7]]:1: error(InvalidMainRunSignature): invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` // CHECK:STDERR: fn Run() -> String {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+3]]:21: error: missing `return` at end of function with declared return type +// CHECK:STDERR: fail_bad_run.carbon:[[@LINE+3]]:21: error(MissingReturnStatement): missing `return` at end of function with declared return type // CHECK:STDERR: fn Run() -> String {} // CHECK:STDERR: ^ fn Run() -> String {} diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index 551fbeef93ae3..78ff97f877c6a 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_bad_run_2.carbon -// CHECK:STDERR: fail_bad_run_2.carbon:[[@LINE+3]]:1: error: invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` +// CHECK:STDERR: fail_bad_run_2.carbon:[[@LINE+3]]:1: error(InvalidMainRunSignature): invalid signature for `Main.Run` function; expected `fn ()` or `fn () -> i32` // CHECK:STDERR: fn Run(n: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~ fn Run(n: i32) {} diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index d588723825dd0..b75a9a3fed340 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_non_type_as_type.carbon -// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+6]]:1: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_non_type_as_type.carbon:[[@LINE+3]]:1: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var x: type = 42; diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 0514a7d00dad6..8e042dee47c04 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -8,31 +8,31 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 39999999999999999993 does not fit in i32 +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error(IntLiteralTooLargeForI32): integer literal with value 39999999999999999993 does not fit in i32 // CHECK:STDERR: let a: i32 = 39999999999999999993; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let a: i32 = 39999999999999999993; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 2147483648 does not fit in i32 +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error(IntLiteralTooLargeForI32): integer literal with value 2147483648 does not fit in i32 // CHECK:STDERR: let b: i32 = 2_147_483_648; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: let b: i32 = 2_147_483_648; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: integer literal with value 2147483648 does not fit in i32 +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error(IntLiteralTooLargeForI32): integer literal with value 2147483648 does not fit in i32 // CHECK:STDERR: let c: i32 = 0x8000_0000; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: let c: i32 = 0x8000_0000; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error: real mantissa with value 399999999999999999930 does not fit in i64 +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+4]]:14: error(RealMantissaTooLargeForI64): real mantissa with value 399999999999999999930 does not fit in i64 // CHECK:STDERR: let d: f64 = 39999999999999999993.0e3; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let d: f64 = 39999999999999999993.0e3; -// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+3]]:14: error: real exponent with value 39999999999999999992 does not fit in i64 +// CHECK:STDERR: fail_numeric_literal_overflow.carbon:[[@LINE+3]]:14: error(RealExponentTooLargeForI64): real exponent with value 39999999999999999992 does not fit in i64 // CHECK:STDERR: let e: f64 = 5.0e39999999999999999993; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ let e: f64 = 5.0e39999999999999999993; diff --git a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon index f4d06aa7e14e6..e41362c39a087 100644 --- a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon +++ b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon var x: i32; -// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:14: error: type `i32` does not support qualified expressions +// CHECK:STDERR: fail_qualifier_unsupported.carbon:[[@LINE+3]]:14: error(QualifiedExprUnsupported): type `i32` does not support qualified expressions // CHECK:STDERR: var y: i32 = x.b; // CHECK:STDERR: ^~~ var y: i32 = x.b; diff --git a/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon b/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon index 9c3df72cbdd12..460b1d639f574 100644 --- a/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon +++ b/toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon fn Main() { - // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+3]]:3: error: name `x` not found + // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+3]]:3: error(NameNotFound): name `x` not found // CHECK:STDERR: x; // CHECK:STDERR: ^ x; diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index a0ad511d880c8..e5135a6c2f5b0 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -18,28 +18,28 @@ var test_i64: i64; // --- fail_iN_bad_width.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: error: name `i0` not found +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: error(NameNotFound): name `i0` not found // CHECK:STDERR: var test_i0: i0; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_i0: i0; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: error: bit width of integer type literal must be a multiple of 8; use `Core.Int(1)` instead +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:14: error(IntWidthNotMultipleOf8): bit width of integer type literal must be a multiple of 8; use `Core.Int(1)` instead // CHECK:STDERR: var test_i1: i1; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_i1: i1; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:15: error: bit width of integer type literal must be a multiple of 8; use `Core.Int(15)` instead +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:15: error(IntWidthNotMultipleOf8): bit width of integer type literal must be a multiple of 8; use `Core.Int(15)` instead // CHECK:STDERR: var test_i15: i15; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_i15: i15; -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:23: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:23: error(IntWidthTooLarge): integer type width of 1000000000 is greater than the maximum supported width of 8388608 // CHECK:STDERR: var test_i1000000000: i1000000000; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: var test_i1000000000: i1000000000; // TODO: This diagnostic is not very good. -// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:33: error: integer literal with value 10000000000000000000 does not fit in i32 +// CHECK:STDERR: fail_iN_bad_width.carbon:[[@LINE+4]]:33: error(IntLiteralTooLargeForI32): integer literal with value 10000000000000000000 does not fit in i32 // CHECK:STDERR: var test_i10000000000000000000: i10000000000000000000; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -55,28 +55,28 @@ var test_u64: u64; // --- fail_uN_bad_width.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: error: name `u0` not found +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: error(NameNotFound): name `u0` not found // CHECK:STDERR: var test_u0: u0; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_u0: u0; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: error: bit width of integer type literal must be a multiple of 8; use `Core.UInt(1)` instead +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:14: error(IntWidthNotMultipleOf8): bit width of integer type literal must be a multiple of 8; use `Core.UInt(1)` instead // CHECK:STDERR: var test_u1: u1; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_u1: u1; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:15: error: bit width of integer type literal must be a multiple of 8; use `Core.UInt(15)` instead +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:15: error(IntWidthNotMultipleOf8): bit width of integer type literal must be a multiple of 8; use `Core.UInt(15)` instead // CHECK:STDERR: var test_u15: u15; // CHECK:STDERR: ^~~ // CHECK:STDERR: var test_u15: u15; -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:23: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:23: error(IntWidthTooLarge): integer type width of 1000000000 is greater than the maximum supported width of 8388608 // CHECK:STDERR: var test_u1000000000: u1000000000; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: var test_u1000000000: u1000000000; // TODO: This diagnostic is not very good. -// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:33: error: integer literal with value 10000000000000000000 does not fit in i32 +// CHECK:STDERR: fail_uN_bad_width.carbon:[[@LINE+4]]:33: error(IntLiteralTooLargeForI32): integer literal with value 10000000000000000000 does not fit in i32 // CHECK:STDERR: var test_u10000000000000000000: u10000000000000000000; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -85,12 +85,12 @@ var test_u10000000000000000000: u10000000000000000000; // --- fail_fN_bad_width.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: error: name `f0` not found +// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: error(NameNotFound): name `f0` not found // CHECK:STDERR: var test_f0: f0; // CHECK:STDERR: ^~ // CHECK:STDERR: var test_f0: f0; -// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: error: semantics TODO: `Currently only f64 is allowed` +// CHECK:STDERR: fail_fN_bad_width.carbon:[[@LINE+4]]:14: error(SemanticsTodo): semantics TODO: `Currently only f64 is allowed` // CHECK:STDERR: var test_f1: f1; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -104,7 +104,7 @@ var test_f1000000000000: f1000000000000; library "[[@TEST_NAME]]"; // TODO: Some or all of these should eventually work. -// CHECK:STDERR: fail_fN_todo_unsupported.carbon:[[@LINE+3]]:15: error: semantics TODO: `Currently only f64 is allowed` +// CHECK:STDERR: fail_fN_todo_unsupported.carbon:[[@LINE+3]]:15: error(SemanticsTodo): semantics TODO: `Currently only f64 is allowed` // CHECK:STDERR: var test_f16: f16; // CHECK:STDERR: ^~~ var test_f16: f16; diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index 6546816ba8998..6ba45ff5a3a34 100644 --- a/toolchain/check/testdata/builtins/float/add.carbon +++ b/toolchain/check/testdata/builtins/float/add.carbon @@ -22,17 +22,17 @@ var x: f64 = Add(2.2, 2.3); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.add" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.add" // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.add"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.add"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.add" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.add" // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.add"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.add"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.add" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.add" // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.add"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn BadReturnType(a: f64, b: f64) -> bool = "float.add"; diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index aea39dbb26970..75f388f5fa028 100644 --- a/toolchain/check/testdata/builtins/float/div.carbon +++ b/toolchain/check/testdata/builtins/float/div.carbon @@ -24,17 +24,17 @@ let c: f64 = Div(0.0, 0.0); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.div" // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.div"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.div"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.div" // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.div" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.div" // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.div"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn BadReturnType(a: f64, b: f64) -> bool = "float.div"; diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index b0ed4cf07e5a3..398d7e2a064c6 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -28,7 +28,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.eq" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.eq" // CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index 0d14708a309c7..b35d3a78c6b35 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -32,14 +32,14 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+4]]:20: error: bit width must be 64 +// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+4]]:20: error(CompileTimeFloatBitWidth): bit width must be 64 // CHECK:STDERR: var invalid_float: Float(32); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: var invalid_float: Float(32); var dyn_size: i32 = 64; -// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression +// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+3]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var dyn: Float(dyn_size); // CHECK:STDERR: ^~~~~~~~~~~~~~~ var dyn: Float(dyn_size); diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index d5311fdfc1c70..45acab100c874 100644 --- a/toolchain/check/testdata/builtins/float/mul.carbon +++ b/toolchain/check/testdata/builtins/float/mul.carbon @@ -22,17 +22,17 @@ var x: f64 = Mul(2.0, 0.5); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.mul" // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.mul"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.mul"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.mul" // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.mul" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.mul" // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.mul"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn BadReturnType(a: f64, b: f64) -> bool = "float.mul"; diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 556fc7d3bcf00..f22b8c0f625c3 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -22,17 +22,17 @@ let a: f64 = Negate(1.5); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.negate" // CHECK:STDERR: fn TooFew() -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew() -> f64 = "float.negate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.negate" // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.negate" // CHECK:STDERR: fn BadReturnType(a: f64) -> bool = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -40,10 +40,10 @@ fn BadReturnType(a: f64) -> bool = "float.negate"; fn JustRight(a: f64) -> f64 = "float.negate"; fn RuntimeCallTooFew(a: f64) -> f64 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 0 arguments + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 1 argument passed to function expecting 0 arguments // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-17]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-17]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn TooFew() -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -51,10 +51,10 @@ fn RuntimeCallTooFew(a: f64) -> f64 { } fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 arguments passed to function expecting 2 arguments + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 3 arguments passed to function expecting 2 arguments // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-23]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-23]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -62,10 +62,10 @@ fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { } fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 arguments passed to function expecting 1 argument + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error(CallArgCountMismatch): 2 arguments passed to function expecting 1 argument // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-29]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-29]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn BadReturnType(a: f64) -> bool = "float.negate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return BadReturnType(a, b); diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index 26e09adf69632..0d63451cecc6a 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -28,7 +28,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.neq" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.neq" // CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index 1346d98da2669..afe09be441190 100644 --- a/toolchain/check/testdata/builtins/float/sub.carbon +++ b/toolchain/check/testdata/builtins/float/sub.carbon @@ -22,17 +22,17 @@ var x: f64 = Sub(2.0, 0.5); package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.sub" // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.sub"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.sub"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.sub" // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "float.sub" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "float.sub" // CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.sub"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn BadReturnType(a: f64, b: f64) -> bool = "float.sub"; diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 507a3ee8580de..6c1775b1f046c 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -28,7 +28,7 @@ fn RuntimeCall(a: i32, b: i32) -> bool { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error: invalid signature for builtin function "int.eq" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+3]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.eq" // CHECK:STDERR: fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index 1eb26bb9d5a5f..4119ba8e396f9 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -30,12 +30,12 @@ fn Negate(a: i32) -> i32 = "int.snegate"; // Shift greater than size is disallowed. let size_1: i32 = LeftShift(1, 31); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error: shift distance not in range [0, 32) in 1 << 32 +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error(CompileTimeShiftOutOfRange): shift distance not in range [0, 32) in 1 << 32 // CHECK:STDERR: let size_2: i32 = LeftShift(1, 32); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: let size_2: i32 = LeftShift(1, 32); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error: shift distance not in range [0, 32) in 1 << 33 +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error(CompileTimeShiftOutOfRange): shift distance not in range [0, 32) in 1 << 33 // CHECK:STDERR: let size_3: i32 = LeftShift(1, 33); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -43,7 +43,7 @@ let size_3: i32 = LeftShift(1, 33); // Overflow is allowed if the shift distance is in bounds. let overflow_1: i32 = LeftShift(1000, 31); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:23: error: shift distance not in range [0, 32) in 1000 << 32 +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:23: error(CompileTimeShiftOutOfRange): shift distance not in range [0, 32) in 1000 << 32 // CHECK:STDERR: let overflow_2: i32 = LeftShift(1000, 32); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -51,14 +51,14 @@ let overflow_2: i32 = LeftShift(1000, 32); // Oversize shifts aren't allowed even if there's no overflow. let no_overflow_1: i32 = LeftShift(0, 31); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:26: error: shift distance not in range [0, 32) in 0 << 32 +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:26: error(CompileTimeShiftOutOfRange): shift distance not in range [0, 32) in 0 << 32 // CHECK:STDERR: let no_overflow_2: i32 = LeftShift(0, 32); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: let no_overflow_2: i32 = LeftShift(0, 32); // Negative shifts aren't allowed either. -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:21: error: shift distance not in range [0, 32) in 1 << -1 +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:21: error(CompileTimeShiftOutOfRange): shift distance not in range [0, 32) in 1 << -1 // CHECK:STDERR: let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDERR: ^~~~~~~~~~ let negative: i32 = LeftShift(1, Negate(1)); diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 0c5824d0244ad..289e51739cb8e 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -38,7 +38,7 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_zero_size.carbon:[[@LINE+4]]:8: error: integer type width of 0 is not positive +// CHECK:STDERR: fail_zero_size.carbon:[[@LINE+4]]:8: error(IntWidthNotPositive): integer type width of 0 is not positive // CHECK:STDERR: var n: Int(0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ import library "types"; fn Negate(n: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: error: integer type width of -1 is not positive +// CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: error(IntWidthNotPositive): integer type width of -1 is not positive // CHECK:STDERR: var n: Int(Negate(1)); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -64,7 +64,7 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 +// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: error(IntWidthTooLarge): integer type width of 1000000000 is greater than the maximum supported width of 8388608 // CHECK:STDERR: var m: Int(1000000000); // CHECK:STDERR: ^~~~ var m: Int(1000000000); diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index 70b36ae60eaa2..e3f78d5865f57 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -38,7 +38,7 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_zero_size.carbon:[[@LINE+4]]:8: error: integer type width of 0 is not positive +// CHECK:STDERR: fail_zero_size.carbon:[[@LINE+4]]:8: error(IntWidthNotPositive): integer type width of 0 is not positive // CHECK:STDERR: var n: UInt(0); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ import library "types"; fn Negate(n: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: error: integer type width of -1 is not positive +// CHECK:STDERR: fail_negative_size.carbon:[[@LINE+4]]:8: error(IntWidthNotPositive): integer type width of -1 is not positive // CHECK:STDERR: var n: UInt(Negate(1)); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -64,7 +64,7 @@ library "[[@TEST_NAME]]"; import library "types"; -// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: error: integer type width of 1000000000 is greater than the maximum supported width of 8388608 +// CHECK:STDERR: fail_oversized.carbon:[[@LINE+3]]:8: error(IntWidthTooLarge): integer type width of 1000000000 is greater than the maximum supported width of 8388608 // CHECK:STDERR: var m: UInt(1000000000); // CHECK:STDERR: ^~~~~ var m: UInt(1000000000); diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index d7c7f0ddfb4bc..009e09ba45b75 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -47,19 +47,19 @@ fn Negate(a: i32) -> i32 = "int.snegate"; // Shift greater than size is disallowed. let size_1: i32 = RightShift(1, 31); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error: shift distance not in range [0, 32) in 1 >> 32 +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error(CompileTimeShiftOutOfRange): shift distance not in range [0, 32) in 1 >> 32 // CHECK:STDERR: let size_2: i32 = RightShift(1, 32); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: let size_2: i32 = RightShift(1, 32); -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error: shift distance not in range [0, 32) in 1 >> 33 +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+4]]:19: error(CompileTimeShiftOutOfRange): shift distance not in range [0, 32) in 1 >> 33 // CHECK:STDERR: let size_3: i32 = RightShift(1, 33); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: let size_3: i32 = RightShift(1, 33); // Negative shifts aren't allowed either. -// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:21: error: shift distance not in range [0, 32) in 1 >> -1 +// CHECK:STDERR: fail_bad_shift.carbon:[[@LINE+3]]:21: error(CompileTimeShiftOutOfRange): shift distance not in range [0, 32) in 1 >> -1 // CHECK:STDERR: let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDERR: ^~~~~~~~~~~ let negative: i32 = RightShift(1, Negate(1)); diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 4145550867fa3..529ef8045e3e2 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -23,43 +23,43 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.sadd" // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.sadd" // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.sadd" // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.sadd"; fn JustRight(a: i32, b: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var too_few: [i32; TooFew(1)]; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var too_few: [i32; TooFew(1)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var too_many: [i32; TooMany(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var too_many: [i32; TooMany(1, 2, 3)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 3 arguments passed to function expecting 2 arguments +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error(CallArgCountMismatch): 3 arguments passed to function expecting 2 arguments // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -84,7 +84,7 @@ package FailOverflow; fn Add(a: i32, b: i32) -> i32 = "int.sadd"; let a: i32 = Add(0x7FFFFFFF, 0); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation 2147483647 + 1 +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error(CompileTimeIntegerOverflow): integer overflow in calculation 2147483647 + 1 // CHECK:STDERR: let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDERR: ^~~~ let b: i32 = Add(0x7FFFFFFF, 1); diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index b5688211e1730..0366c7e51cbd9 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -34,7 +34,7 @@ let a: i32 = Div(Negate(0x7FFF_FFFF), Negate(1)); let b: i32 = Div(Sub(Negate(0x7FFF_FFFF), 1), 1); // -0x8000_0000 / -1 overflows. -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error: integer overflow in calculation -2147483648 / -1 +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error(CompileTimeIntegerOverflow): integer overflow in calculation -2147483648 / -1 // CHECK:STDERR: let c: i32 = Div(Sub(Negate(0x7FFF_FFFF), 1), Negate(1)); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -46,13 +46,13 @@ package FailDivByZero; fn Div(a: i32, b: i32) -> i32 = "int.sdiv"; -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error(CompileTimeDivisionByZero): division by zero // CHECK:STDERR: let a: i32 = Div(1, 0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: let a: i32 = Div(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error(CompileTimeDivisionByZero): division by zero // CHECK:STDERR: let b: i32 = Div(0, 0); // CHECK:STDERR: ^~~~ let b: i32 = Div(0, 0); diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index a5563364e3962..d18235fe6b6aa 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -35,7 +35,7 @@ let b: i32 = Mod(Sub(Negate(0x7FFF_FFFF), 1), 1); // -0x8000_0000 / -1 overflows, so -0x8000_0000 % -1 is disallowed, even though // its result is representable. -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error: integer overflow in calculation -2147483648 % -1 +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+4]]:14: error(CompileTimeIntegerOverflow): integer overflow in calculation -2147483648 % -1 // CHECK:STDERR: let c: i32 = Mod(Sub(Negate(0x7FFF_FFFF), 1), Negate(1)); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -49,13 +49,13 @@ fn Mod(a: i32, b: i32) -> i32 = "int.smod"; // Remainder of division by zero is not defined. -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error(CompileTimeDivisionByZero): division by zero // CHECK:STDERR: let a: i32 = Mod(1, 0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: let a: i32 = Mod(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error(CompileTimeDivisionByZero): division by zero // CHECK:STDERR: let b: i32 = Mod(0, 0); // CHECK:STDERR: ^~~~ let b: i32 = Mod(0, 0); diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index b8b5f7fb52f42..ae7863bf1214c 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -26,7 +26,7 @@ package FailOverflow; fn Mul(a: i32, b: i32) -> i32 = "int.smul"; let a: i32 = Mul(0x7FFF, 0x10000); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation 32768 * 65536 +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error(CompileTimeIntegerOverflow): integer overflow in calculation 32768 * 65536 // CHECK:STDERR: let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDERR: ^~~~ let b: i32 = Mul(0x8000, 0x10000); diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index e5a37b3a9ff49..eaa0afc6c7096 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -25,53 +25,53 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.snegate" // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.snegate" // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.snegate" // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate"; fn JustRight(a: i32) -> i32 = "int.snegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var too_few: [i32; TooFew()]; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var too_few: [i32; TooFew()]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var too_many: [i32; TooMany(1, 2)]; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var too_many: [i32; TooMany(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1)]; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 2 arguments passed to function expecting 1 argument +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error(CallArgCountMismatch): 2 arguments passed to function expecting 1 argument // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn JustRight(a: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; fn RuntimeCallTooFew(a: i32) -> i32 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 0 arguments + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 1 argument passed to function expecting 0 arguments // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -79,10 +79,10 @@ fn RuntimeCallTooFew(a: i32) -> i32 { } fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 arguments passed to function expecting 2 arguments + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 3 arguments passed to function expecting 2 arguments // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -90,10 +90,10 @@ fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { } fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 2 arguments passed to function expecting 1 argument + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 2 arguments passed to function expecting 1 argument // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -111,7 +111,7 @@ fn Sub(a: i32, b: i32) -> i32 = "int.ssub"; let a: i32 = Negate(Negate(0x7FFFFFFF)); // -(-INT_MAX - 1) is too large for i32. -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in negation of -2147483648 +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error(CompileTimeIntegerNegateOverflow): integer overflow in negation of -2147483648 // CHECK:STDERR: let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDERR: ^~~~~~~ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index 9186925e2c81b..c9e1275e07900 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -27,7 +27,7 @@ fn Sub(a: i32, b: i32) -> i32 = "int.ssub"; let a: i32 = Sub(0, 0x7FFFFFFF); let b: i32 = Sub(Sub(0, 0x7FFFFFFF), 1); -// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error: integer overflow in calculation -2147483647 - 2 +// CHECK:STDERR: fail_overflow.carbon:[[@LINE+3]]:14: error(CompileTimeIntegerOverflow): integer overflow in calculation -2147483647 - 2 // CHECK:STDERR: let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDERR: ^~~~ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index a593589c3000d..35254587a9f0b 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -23,43 +23,43 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.uadd" // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.uadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.uadd" // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.uadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.uadd" // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.uadd"; fn JustRight(a: i32, b: i32) -> i32 = "int.uadd"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var too_few: [i32; TooFew(1)]; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var too_few: [i32; TooFew(1)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var too_many: [i32; TooMany(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var too_many: [i32; TooMany(1, 2, 3)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:21: error: 3 arguments passed to function expecting 2 arguments +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:21: error(CallArgCountMismatch): 3 arguments passed to function expecting 2 arguments // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.uadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var bad_call: [i32; JustRight(1, 2, 3)]; diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 964b60d081716..e96eb05707263 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -42,13 +42,13 @@ package FailDivByZero; fn Div(a: i32, b: i32) -> i32 = "int.udiv"; -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error(CompileTimeDivisionByZero): division by zero // CHECK:STDERR: let a: i32 = Div(1, 0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: let a: i32 = Div(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error(CompileTimeDivisionByZero): division by zero // CHECK:STDERR: let b: i32 = Div(0, 0); // CHECK:STDERR: ^~~~ let b: i32 = Div(0, 0); diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 4ef8043aa7cd3..e7c67e3d872a2 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -44,13 +44,13 @@ fn Mod(a: i32, b: i32) -> i32 = "int.umod"; // Remainder of division by zero is not defined. -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error: division by zero +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+4]]:14: error(CompileTimeDivisionByZero): division by zero // CHECK:STDERR: let a: i32 = Mod(1, 0); // CHECK:STDERR: ^~~~ // CHECK:STDERR: let a: i32 = Mod(1, 0); -// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error: division by zero +// CHECK:STDERR: fail_div_by_zero.carbon:[[@LINE+3]]:14: error(CompileTimeDivisionByZero): division by zero // CHECK:STDERR: let b: i32 = Mod(0, 0); // CHECK:STDERR: ^~~~ let b: i32 = Mod(0, 0); diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 6ebcf71170033..ea3251f05784d 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -25,53 +25,53 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { package FailBadDecl; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.unegate" // CHECK:STDERR: fn TooFew() -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooFew() -> i32 = "int.unegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.unegate" // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.unegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error(InvalidBuiltinSignature): invalid signature for builtin function "int.unegate" // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.unegate"; fn JustRight(a: i32) -> i32 = "int.unegate"; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:20: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var too_few: [i32; TooFew()]; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var too_few: [i32; TooFew()]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:21: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var too_many: [i32; TooMany(1, 2)]; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var too_many: [i32; TooMany(1, 2)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error: array bound is not a constant +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:28: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1)]; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: var bad_return_type: [i32; BadReturnType(1)]; -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error: 2 arguments passed to function expecting 1 argument +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:21: error(CallArgCountMismatch): 2 arguments passed to function expecting 1 argument // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here +// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn JustRight(a: i32) -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; fn RuntimeCallTooFew(a: i32) -> i32 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 0 arguments + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 1 argument passed to function expecting 0 arguments // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn TooFew() -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -79,10 +79,10 @@ fn RuntimeCallTooFew(a: i32) -> i32 { } fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 arguments passed to function expecting 2 arguments + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 3 arguments passed to function expecting 2 arguments // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -90,10 +90,10 @@ fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { } fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 arguments passed to function expecting 1 argument + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error(CallArgCountMismatch): 2 arguments passed to function expecting 1 argument // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note: calling function declared here + // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.unegate"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return BadReturnType(a, b); diff --git a/toolchain/check/testdata/class/access_modifers.carbon b/toolchain/check/testdata/class/access_modifers.carbon index 20ba43da38723..e29044ba8add7 100644 --- a/toolchain/check/testdata/class/access_modifers.carbon +++ b/toolchain/check/testdata/class/access_modifers.carbon @@ -27,35 +27,35 @@ class Circle { fn Run() { let circle: Circle = Circle.Make(); - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:21: error: cannot access private member `radius` of type `Circle` + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:21: error(ClassInvalidMemberAccess): cannot access private member `radius` of type `Circle` // CHECK:STDERR: let radius: i32 = circle.radius; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-17]]:15: note: declared here + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-17]]:15: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private var radius: i32; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: let radius: i32 = circle.radius; - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `radius` of type `Circle` + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error(ClassInvalidMemberAccess): cannot access private member `radius` of type `Circle` // CHECK:STDERR: circle.radius = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-25]]:15: note: declared here + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-25]]:15: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private var radius: i32; // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: circle.radius = 5; - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `SOME_INTERNAL_CONSTANT` of type `Circle` + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error(ClassInvalidMemberAccess): cannot access private member `SOME_INTERNAL_CONSTANT` of type `Circle` // CHECK:STDERR: circle.SOME_INTERNAL_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-32]]:15: note: declared here + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-32]]:15: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private let SOME_INTERNAL_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: circle.SOME_INTERNAL_CONSTANT; - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error: cannot access private member `SomeInternalFunction` of type `Circle` + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE+7]]:3: error(ClassInvalidMemberAccess): cannot access private member `SomeInternalFunction` of type `Circle` // CHECK:STDERR: circle.SomeInternalFunction(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-39]]:3: note: declared here + // CHECK:STDERR: fail_private_field_access.carbon:[[@LINE-39]]:3: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private fn SomeInternalFunction() -> i32 { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -71,10 +71,10 @@ class A { } fn Run() { - // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE+7]]:16: error: cannot access protected member `x` of type `A` + // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE+7]]:16: error(ClassInvalidMemberAccess): cannot access protected member `x` of type `A` // CHECK:STDERR: let x: i32 = A.x; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE-7]]:17: note: declared here + // CHECK:STDERR: fail_protected_field_access.carbon:[[@LINE-7]]:17: note(ClassMemberDeclaration): declared here // CHECK:STDERR: protected var x: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -120,18 +120,18 @@ class A { private let y: i32 = 5; } -// CHECK:STDERR: fail_global_access.carbon:[[@LINE+7]]:14: error: cannot access protected member `x` of type `A` +// CHECK:STDERR: fail_global_access.carbon:[[@LINE+7]]:14: error(ClassInvalidMemberAccess): cannot access protected member `x` of type `A` // CHECK:STDERR: let x: i32 = A.x; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_global_access.carbon:[[@LINE-7]]:17: note: declared here +// CHECK:STDERR: fail_global_access.carbon:[[@LINE-7]]:17: note(ClassMemberDeclaration): declared here // CHECK:STDERR: protected let x: i32 = 5; // CHECK:STDERR: ^ // CHECK:STDERR: let x: i32 = A.x; -// CHECK:STDERR: fail_global_access.carbon:[[@LINE+6]]:14: error: cannot access private member `y` of type `A` +// CHECK:STDERR: fail_global_access.carbon:[[@LINE+6]]:14: error(ClassInvalidMemberAccess): cannot access private member `y` of type `A` // CHECK:STDERR: let y: i32 = A.y; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_global_access.carbon:[[@LINE-14]]:15: note: declared here +// CHECK:STDERR: fail_global_access.carbon:[[@LINE-14]]:15: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private let y: i32 = 5; // CHECK:STDERR: ^ let y: i32 = A.y; diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index 2c9d437febec0..1a6f4b72afd83 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -39,7 +39,7 @@ class AdaptNotExtend { fn F(a: AdaptNotExtend) { // `Adapted` is not extended, so lookup for `F` finds nothing. - // CHECK:STDERR: fail_not_extend.carbon:[[@LINE+3]]:3: error: name `F` not found + // CHECK:STDERR: fail_not_extend.carbon:[[@LINE+3]]:3: error(NameNotFound): name `F` not found // CHECK:STDERR: a.F(); // CHECK:STDERR: ^~~ a.F(); diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index 23f0f62dbf172..87f2a7574fb41 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -48,11 +48,11 @@ library "[[@TEST_NAME]]"; import Other library "other_extern"; -// CHECK:STDERR: fail_extern.carbon:[[@LINE+8]]:8: error: variable has incomplete type `C` +// CHECK:STDERR: fail_extern.carbon:[[@LINE+8]]:8: error(IncompleteTypeInVarDecl): variable has incomplete type `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: other_extern.carbon:4:1: note: class was forward declared here +// CHECK:STDERR: fail_extern.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: other_extern.carbon:4:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -62,18 +62,18 @@ var c: Other.C = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: other_extern.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: other_extern.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: other_define.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: other_define.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ import Other library "other_define"; import Other library "other_extern"; -// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:8: note: in name lookup for `C` +// CHECK:STDERR: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:8: note(InNameLookup): in name lookup for `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -83,18 +83,18 @@ var c: Other.C = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: other_conflict.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: other_conflict.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: other_define.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: other_define.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ import Other library "other_define"; import Other library "other_conflict"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:8: note: in name lookup for `C` +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:8: note(InNameLookup): in name lookup for `C` // CHECK:STDERR: var c: Other.C = {}; // CHECK:STDERR: ^~~~~~~ var c: Other.C = {}; diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index a9c3c533d42de..9ba6b704c84d0 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -48,13 +48,13 @@ class SomeClassAdapter { } fn F(a: SomeClassAdapter) { - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `SomeClassAdapter` to `SomeClass` // CHECK:STDERR: a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: note: type `SomeClassAdapter` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: note(MissingImplInMemberAccessNote): type `SomeClassAdapter` does not implement interface `ImplicitAs` // CHECK:STDERR: a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: note: initializing `self` parameter of method declared here + // CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: note(InCallToFunctionSelf): initializing `self` parameter of method declared here // CHECK:STDERR: fn F[self: Self](); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -75,10 +75,10 @@ class SomeClassAdapter { } fn F(a: SomeClassAdapter) -> i32 { - // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass` + // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+7]]:10: error(ImplicitAsConversionFailure): cannot implicitly convert from `SomeClassAdapter` to `SomeClass` // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: note: type `SomeClassAdapter` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: note(MissingImplInMemberAccessNote): type `SomeClassAdapter` does not implement interface `ImplicitAs` // CHECK:STDERR: return a.b; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ fn F(a: SomeClassAdapter) -> i32 { library "[[@TEST_NAME]]"; class StructAdapter { - // CHECK:STDERR: fail_todo_adapt_non_class.carbon:[[@LINE+3]]:3: error: semantics TODO: `extending non-class type` + // CHECK:STDERR: fail_todo_adapt_non_class.carbon:[[@LINE+3]]:3: error(SemanticsTodo): semantics TODO: `extending non-class type` // CHECK:STDERR: extend adapt {.a: i32, .b: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extend adapt {.a: i32, .b: i32}; diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index 17122ccbc1bf9..c4883d61307d5 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -16,10 +16,10 @@ abstract class Abstract { } class Contains { - // CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: field has abstract type `Abstract` + // CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error(AbstractTypeInVarDecl): field has abstract type `Abstract` // CHECK:STDERR: var a: Abstract; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_abstract_field.carbon:[[@LINE-7]]:1: note: class was declared abstract here + // CHECK:STDERR: fail_abstract_field.carbon:[[@LINE-7]]:1: note(ClassAbstractHere): class was declared abstract here // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -34,10 +34,10 @@ abstract class Abstract { } fn Var() { - // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE+7]]:10: error: variable has abstract type `Abstract` + // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE+7]]:10: error(AbstractTypeInVarDecl): variable has abstract type `Abstract` // CHECK:STDERR: var v: Abstract; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE-7]]:1: note: class was declared abstract here + // CHECK:STDERR: fail_abstract_var.carbon:[[@LINE-7]]:1: note(ClassAbstractHere): class was declared abstract here // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,10 +64,10 @@ abstract class Abstract { class Adapter { // TODO(#4387): This should probably be valid - // CHECK:STDERR: fail_abstract_adapter.carbon:[[@LINE+7]]:3: error: adapted type `Abstract` is an abstract type + // CHECK:STDERR: fail_abstract_adapter.carbon:[[@LINE+7]]:3: error(AbstractTypeInAdaptDecl): adapted type `Abstract` is an abstract type // CHECK:STDERR: adapt Abstract; // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_abstract_adapter.carbon:[[@LINE-8]]:1: note: class was declared abstract here + // CHECK:STDERR: fail_abstract_adapter.carbon:[[@LINE-8]]:1: note(ClassAbstractHere): class was declared abstract here // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -102,10 +102,10 @@ class Derived { fn Make() -> Derived { // TODO: This should be valid, and should construct an instance of `partial Abstract` as the base. - // CHECK:STDERR: fail_todo_return_nonabstract_derived.carbon:[[@LINE+7]]:10: error: initialization of abstract type `Abstract` + // CHECK:STDERR: fail_todo_return_nonabstract_derived.carbon:[[@LINE+7]]:10: error(AbstractTypeInInit): initialization of abstract type `Abstract` // CHECK:STDERR: return {.base = {.a = 1}, .d = 7}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_return_nonabstract_derived.carbon:[[@LINE-14]]:1: note: class was declared abstract here + // CHECK:STDERR: fail_todo_return_nonabstract_derived.carbon:[[@LINE-14]]:1: note(ClassAbstractHere): class was declared abstract here // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -127,10 +127,10 @@ class Derived { fn Return(a: Abstract) -> Abstract { // FIXME: Seems like this would be better off failing with "function returns abstract type" here instead of this \/ - // CHECK:STDERR: fail_return_abstract.carbon:[[@LINE+7]]:3: error: initialization of abstract type `Abstract` + // CHECK:STDERR: fail_return_abstract.carbon:[[@LINE+7]]:3: error(AbstractTypeInInit): initialization of abstract type `Abstract` // CHECK:STDERR: return a; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_return_abstract.carbon:[[@LINE-14]]:1: note: class was declared abstract here + // CHECK:STDERR: fail_return_abstract.carbon:[[@LINE-14]]:1: note(ClassAbstractHere): class was declared abstract here // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -176,13 +176,13 @@ abstract class Abstract { fn ReturnAbstract() -> Abstract; fn CallReturnAbstract() { - // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE+9]]:3: error: function returns abstract type `Abstract` + // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE+9]]:3: error(AbstractTypeInFunctionReturnType): function returns abstract type `Abstract` // CHECK:STDERR: ReturnAbstract(); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:1: note: class was declared abstract here + // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:1: note(ClassAbstractHere): class was declared abstract here // CHECK:STDERR: abstract class Abstract { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:21: note: return type declared here + // CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:21: note(IncompleteReturnTypeHere): return type declared here // CHECK:STDERR: fn ReturnAbstract() -> Abstract; // CHECK:STDERR: ^~~~~~~~~~~ ReturnAbstract(); diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index 1a62974af1de3..6357c5d44b27e 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -13,17 +13,17 @@ library "[[@TEST_NAME]]"; class Bad { - // CHECK:STDERR: fail_not_type.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `type` + // CHECK:STDERR: fail_not_type.carbon:[[@LINE+7]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: adapt 100; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:3: note: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:3: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: adapt 100; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: adapt 100; } -// CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:18: error: name `F` not found +// CHECK:STDERR: fail_not_type.carbon:[[@LINE+4]]:18: error(NameNotFound): name `F` not found // CHECK:STDERR: fn Use(b: Bad) { b.F(); } // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -34,10 +34,10 @@ fn Use(b: Bad) { b.F(); } library "[[@TEST_NAME]]"; class Bad { - // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `type` + // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+7]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: extend adapt 100; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+4]]:3: note: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_extend_not_type.carbon:[[@LINE+4]]:3: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: extend adapt 100; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -53,10 +53,10 @@ library "[[@TEST_NAME]]"; class MultipleAdapts { adapt (); - // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: multiple `adapt` declarations in class + // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error(AdaptDeclRepeated): multiple `adapt` declarations in class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: note: previous `adapt` declaration is here + // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: note(ClassSpecificDeclPrevious): previous `adapt` declaration is here // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -65,10 +65,10 @@ class MultipleAdapts { class MultipleAdaptsSameType { adapt (); - // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error: multiple `adapt` declarations in class + // CHECK:STDERR: fail_repeated.carbon:[[@LINE+7]]:3: error(AdaptDeclRepeated): multiple `adapt` declarations in class // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: note: previous `adapt` declaration is here + // CHECK:STDERR: fail_repeated.carbon:[[@LINE-4]]:3: note(ClassSpecificDeclPrevious): previous `adapt` declaration is here // CHECK:STDERR: adapt (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -79,14 +79,14 @@ class MultipleAdaptsSameType { library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:1: error: `adapt` declaration outside class +// CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:1: error(ClassSpecificDeclOutsideClass): `adapt` declaration outside class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: adapt {}; interface I { - // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:3: error: `adapt` declaration outside class + // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+4]]:3: error(ClassSpecificDeclOutsideClass): `adapt` declaration outside class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -95,7 +95,7 @@ interface I { class C { interface I { - // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+3]]:5: error: `adapt` declaration outside class + // CHECK:STDERR: fail_bad_scope.carbon:[[@LINE+3]]:5: error(ClassSpecificDeclOutsideClass): `adapt` declaration outside class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ adapt {}; diff --git a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon index 3889d4bd075cd..285fcff741ca1 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon @@ -15,10 +15,10 @@ library "[[@TEST_NAME]]"; class Incomplete; class AdaptIncomplete { - // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:3: error: adapted type `Incomplete` is an incomplete type + // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+6]]:3: error(IncompleteTypeInAdaptDecl): adapted type `Incomplete` is an incomplete type // CHECK:STDERR: adapt Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-6]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-6]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ adapt Incomplete; diff --git a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon index 0871c4f8e35ea..1564dc341fb3d 100644 --- a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon @@ -11,7 +11,7 @@ class B {} class C1 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error: `private` not allowed on `adapt` declaration + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error(ModifierNotAllowedOnDeclaration): `private` not allowed on `adapt` declaration // CHECK:STDERR: private adapt B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -19,7 +19,7 @@ class C1 { } class C2 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error: `abstract` not allowed on `adapt` declaration + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error(ModifierNotAllowedOnDeclaration): `abstract` not allowed on `adapt` declaration // CHECK:STDERR: abstract adapt B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -27,7 +27,7 @@ class C2 { } class C3 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed on `adapt` declaration + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: error(ModifierNotAllowedOnDeclaration): `default` not allowed on `adapt` declaration // CHECK:STDERR: default adapt B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -35,10 +35,10 @@ class C3 { } class C4 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+7]]:10: error: `extend` repeated on declaration + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+7]]:10: error(ModifierRepeated): `extend` repeated on declaration // CHECK:STDERR: extend extend adapt B; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: note: `extend` previously appeared here + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+4]]:3: note(ModifierPrevious): `extend` previously appeared here // CHECK:STDERR: extend extend adapt B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -46,10 +46,10 @@ class C4 { } class C5 { - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+6]]:10: error: `base` not allowed on declaration with `extend` + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+6]]:10: error(ModifierNotAllowedWith): `base` not allowed on declaration with `extend` // CHECK:STDERR: extend base adapt B; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+3]]:3: note: `extend` previously appeared here + // CHECK:STDERR: fail_adapt_modifiers.carbon:[[@LINE+3]]:3: note(ModifierPrevious): `extend` previously appeared here // CHECK:STDERR: extend base adapt B; // CHECK:STDERR: ^~~~~~ extend base adapt B; diff --git a/toolchain/check/testdata/class/fail_adapt_with_base.carbon b/toolchain/check/testdata/class/fail_adapt_with_base.carbon index 6e5e3b0e43bdc..adc7b84288c20 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_base.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_base.carbon @@ -10,10 +10,10 @@ class Simple {}; base class AdaptWithVirtual { virtual fn F(); - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+6]]:3: error: adapter with virtual function + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+6]]:3: error(AdaptWithVirtual): adapter with virtual function // CHECK:STDERR: adapt Simple; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE-4]]:3: note: first virtual function declaration is here + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE-4]]:3: note(AdaptWithVirtualHere): first virtual function declaration is here // CHECK:STDERR: virtual fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ adapt Simple; diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index 7c502c1335a57..4f775974e4754 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -15,11 +15,11 @@ library "[[@TEST_NAME]]"; base class Base {} class AdaptWithBase { - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+3]]:3: error: adapter with base class + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+3]]:3: error(AdaptWithBase): adapter with base class // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+4]]:3: note: `base` declaration is here + // CHECK:STDERR: fail_adapt_with_base.carbon:[[@LINE+4]]:3: note(AdaptWithBaseHere): `base` declaration is here // CHECK:STDERR: extend base: Base; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,11 +31,11 @@ class AdaptWithBase { library "[[@TEST_NAME]]"; class AdaptWithField { - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error: adapter with fields + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error(AdaptWithFields): adapter with fields // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: note: first field declaration is here + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: note(AdaptWithFieldHere): first field declaration is here // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -43,11 +43,11 @@ class AdaptWithField { } class AdaptWithFields { - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error: adapter with fields + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+3]]:3: error(AdaptWithFields): adapter with fields // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~~~~~~ adapt i32; - // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: note: first field declaration is here + // CHECK:STDERR: fail_adapt_with_fields.carbon:[[@LINE+4]]:7: note(AdaptWithFieldHere): first field declaration is here // CHECK:STDERR: var a: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -65,10 +65,10 @@ base class Base {} class AdaptWithBaseAndFields { extend base: Base; var n: i32; - // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+6]]:3: error: adapter with base class + // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE+6]]:3: error(AdaptWithBase): adapter with base class // CHECK:STDERR: adapt {}; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE-5]]:3: note: `base` declaration is here + // CHECK:STDERR: fail_adapt_with_base_and_fields.carbon:[[@LINE-5]]:3: note(AdaptWithBaseHere): `base` declaration is here // CHECK:STDERR: extend base: Base; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ adapt {}; diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index 5d45933528ccd..ddad5dc037cfd 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_addr_not_self.carbon class Class { - // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+4]]:8: error: `addr` can only be applied to a `self` parameter + // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+4]]:8: error(AddrOnNonSelfParam): `addr` can only be applied to a `self` parameter // CHECK:STDERR: fn F[addr a:! Class*](); // CHECK:STDERR: ^~~~ // CHECK:STDERR: fn F[addr a:! Class*](); - // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+3]]:8: error: `addr` can only be applied to a `self` parameter + // CHECK:STDERR: fail_addr_not_self.carbon:[[@LINE+3]]:8: error(AddrOnNonSelfParam): `addr` can only be applied to a `self` parameter // CHECK:STDERR: fn G(addr b: Class*); // CHECK:STDERR: ^~~~ fn G(addr b: Class*); diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index 8c8875389ec24..827d9578d4f72 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -10,7 +10,7 @@ class Class { fn F[addr self: Class*](); - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+4]]:8: error: `addr` can only be applied to a binding with a pointer type + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+4]]:8: error(AddrOnNonPointerType): `addr` can only be applied to a binding with a pointer type // CHECK:STDERR: fn G[addr self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -18,10 +18,10 @@ class Class { } fn F(c: Class, p: Class*) { - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE+6]]:3: error(AddrSelfIsNonRef): `addr self` method cannot be invoked on a value // CHECK:STDERR: c.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-12]]:8: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_addr_self.carbon:[[@LINE-12]]:8: note(InCallToFunctionSelf): initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: Class*](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ c.F(); diff --git a/toolchain/check/testdata/class/fail_base_as_declared_name.carbon b/toolchain/check/testdata/class/fail_base_as_declared_name.carbon index 297a51e054023..d276cb47eca3c 100644 --- a/toolchain/check/testdata/class/fail_base_as_declared_name.carbon +++ b/toolchain/check/testdata/class/fail_base_as_declared_name.carbon @@ -10,11 +10,11 @@ namespace N; -// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+7]]:6: error: `.` should be followed by a name +// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+7]]:6: error(ExpectedDeclNameAfterPeriod): `.` should be followed by a name // CHECK:STDERR: fn N.base() {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+3]]:6: error: semantics TODO: `HandleInvalidParse` +// CHECK:STDERR: fail_base_as_declared_name.carbon:[[@LINE+3]]:6: error(SemanticsTodo): semantics TODO: `HandleInvalidParse` // CHECK:STDERR: fn N.base() {} // CHECK:STDERR: ^~~~ fn N.base() {} diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index f5f53cd1f2b63..a76d1100a6cfc 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -11,11 +11,11 @@ // --- fail_derive_from_error.carbon class DeriveFromError { - // CHECK:STDERR: fail_derive_from_error.carbon:[[@LINE+6]]:16: error: name `error` not found + // CHECK:STDERR: fail_derive_from_error.carbon:[[@LINE+6]]:16: error(NameNotFound): name `error` not found // CHECK:STDERR: extend base: error; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_derive_from_non_type.carbon: error: `Main//default` previously provided by `fail_derive_from_error.carbon` + // CHECK:STDERR: fail_derive_from_non_type.carbon: error(DuplicateMainApi): `Main//default` previously provided by `fail_derive_from_error.carbon` // CHECK:STDERR: extend base: error; } @@ -26,14 +26,14 @@ fn AccessMemberWithInvalidBaseError(p: DeriveFromError*) -> i32 { return (*p).n; // --- fail_derive_from_non_type.carbon class DeriveFromNonType { - // CHECK:STDERR: fail_derive_from_non_type.carbon:[[@LINE+9]]:16: error: cannot implicitly convert from `i32` to `type` + // CHECK:STDERR: fail_derive_from_non_type.carbon:[[@LINE+9]]:16: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: extend base: 32; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_derive_from_non_type.carbon:[[@LINE+6]]:16: note: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_derive_from_non_type.carbon:[[@LINE+6]]:16: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: extend base: 32; // CHECK:STDERR: ^~ // CHECK:STDERR: - // CHECK:STDERR: fail_derive_from_i32.carbon: error: `Main//default` previously provided by `fail_derive_from_error.carbon` + // CHECK:STDERR: fail_derive_from_i32.carbon: error(DuplicateMainApi): `Main//default` previously provided by `fail_derive_from_error.carbon` // CHECK:STDERR: extend base: 32; } @@ -43,7 +43,7 @@ fn AccessMemberWithInvalidBasNonType(p: DeriveFromNonType*) -> i32 { return (*p) // --- fail_derive_from_i32.carbon class DeriveFromi32 { - // CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+4]]:16: error: deriving from final type `i32`; base type must be an `abstract` or `base` class + // CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+4]]:16: error(BaseIsFinal): deriving from final type `i32`; base type must be an `abstract` or `base` class // CHECK:STDERR: extend base: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -52,14 +52,14 @@ class DeriveFromi32 { // It's not really important whether this conversion produces an error or not, // but it shouldn't crash. -// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+9]]:53: error: cannot implicitly convert from `DeriveFromi32*` to `i32*` +// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+9]]:53: error(ImplicitAsConversionFailure): cannot implicitly convert from `DeriveFromi32*` to `i32*` // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+6]]:53: note: type `DeriveFromi32*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_derive_from_i32.carbon:[[@LINE+6]]:53: note(MissingImplInMemberAccessNote): type `DeriveFromi32*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_derive_from_tuple.carbon: error: `Main//default` previously provided by `fail_derive_from_error.carbon` +// CHECK:STDERR: fail_derive_from_tuple.carbon: error(DuplicateMainApi): `Main//default` previously provided by `fail_derive_from_error.carbon` // CHECK:STDERR: fn ConvertToBadBasei32(p: DeriveFromi32*) -> i32* { return p; } @@ -70,21 +70,21 @@ fn AccessMemberWithInvalidBasei32(p: DeriveFromi32*) -> i32 { return (*p).n; } base class Base {} class DeriveFromTuple { - // CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+4]]:16: error: deriving from final type `(Base,)`; base type must be an `abstract` or `base` class + // CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+4]]:16: error(BaseIsFinal): deriving from final type `(Base,)`; base type must be an `abstract` or `base` class // CHECK:STDERR: extend base: (Base,); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: extend base: (Base,); } -// CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+9]]:61: error: cannot implicitly convert from `DeriveFromTuple*` to `(Base,)*` +// CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+9]]:61: error(ImplicitAsConversionFailure): cannot implicitly convert from `DeriveFromTuple*` to `(Base,)*` // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+6]]:61: note: type `DeriveFromTuple*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_derive_from_tuple.carbon:[[@LINE+6]]:61: note(MissingImplInMemberAccessNote): type `DeriveFromTuple*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_derive_from_struct.carbon: error: `Main//default` previously provided by `fail_derive_from_error.carbon` +// CHECK:STDERR: fail_derive_from_struct.carbon: error(DuplicateMainApi): `Main//default` previously provided by `fail_derive_from_error.carbon` // CHECK:STDERR: fn ConvertToBadBaseTuple(p: DeriveFromTuple*) -> (Base,)* { return p; } @@ -95,21 +95,21 @@ fn AccessMemberWithInvalidBaseTuple(p: DeriveFromTuple*) -> i32 { return (*p).n; // TODO: Should we allow this? // We do allow `{.base = {.a: i32, .b: i32}}`. class DeriveFromStruct { - // CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+4]]:16: error: deriving from final type `{.a: i32, .b: i32}`; base type must be an `abstract` or `base` class + // CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+4]]:16: error(BaseIsFinal): deriving from final type `{.a: i32, .b: i32}`; base type must be an `abstract` or `base` class // CHECK:STDERR: extend base: {.a: i32, .b: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extend base: {.a: i32, .b: i32}; } -// CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+9]]:74: error: cannot implicitly convert from `DeriveFromStruct*` to `{.a: i32, .b: i32}*` +// CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+9]]:74: error(ImplicitAsConversionFailure): cannot implicitly convert from `DeriveFromStruct*` to `{.a: i32, .b: i32}*` // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+6]]:74: note: type `DeriveFromStruct*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_derive_from_struct.carbon:[[@LINE+6]]:74: note(MissingImplInMemberAccessNote): type `DeriveFromStruct*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_derive_from_incomplete.carbon: error: `Main//default` previously provided by `fail_derive_from_error.carbon` +// CHECK:STDERR: fail_derive_from_incomplete.carbon: error(DuplicateMainApi): `Main//default` previously provided by `fail_derive_from_error.carbon` // CHECK:STDERR: fn ConvertToBadBaseStruct(p: DeriveFromStruct*) -> {.a: i32, .b: i32}* { return p; } @@ -118,31 +118,31 @@ fn AccessMemberWithInvalidBaseStruct(p: DeriveFromStruct*) -> i32 { return (*p). // --- fail_derive_from_incomplete.carbon -// CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+4]]:1: error: `base` not allowed on `class` forward declaration, only definition +// CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+4]]:1: error(ModifierOnlyAllowedOnDefinition): `base` not allowed on `class` forward declaration, only definition // CHECK:STDERR: base class Incomplete; // CHECK:STDERR: ^~~~ // CHECK:STDERR: base class Incomplete; class DeriveFromIncomplete { - // CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+7]]:16: error: base `Incomplete` is an incomplete type + // CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+7]]:16: error(IncompleteTypeInBaseDecl): base `Incomplete` is an incomplete type // CHECK:STDERR: extend base: Incomplete; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE-6]]:1: note: class was forward declared here + // CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE-6]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: base class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extend base: Incomplete; } -// CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+9]]:74: error: cannot implicitly convert from `DeriveFromIncomplete*` to `Incomplete*` +// CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+9]]:74: error(ImplicitAsConversionFailure): cannot implicitly convert from `DeriveFromIncomplete*` to `Incomplete*` // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+6]]:74: note: type `DeriveFromIncomplete*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_derive_from_incomplete.carbon:[[@LINE+6]]:74: note(MissingImplInMemberAccessNote): type `DeriveFromIncomplete*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_derive_from_final.carbon: error: `Main//default` previously provided by `fail_derive_from_error.carbon` +// CHECK:STDERR: fail_derive_from_final.carbon: error(DuplicateMainApi): `Main//default` previously provided by `fail_derive_from_error.carbon` // CHECK:STDERR: fn ConvertToBadBaseIncomplete(p: DeriveFromIncomplete*) -> Incomplete* { return p; } @@ -155,7 +155,7 @@ class Final { } class DeriveFromFinal { - // CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+4]]:16: error: deriving from final type `Final`; base type must be an `abstract` or `base` class + // CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+4]]:16: error(BaseIsFinal): deriving from final type `Final`; base type must be an `abstract` or `base` class // CHECK:STDERR: extend base: Final; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -172,7 +172,7 @@ fn AccessMemberWithInvalidBaseFinal_WithMember(p: DeriveFromFinal*) -> i32 { } fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { - // CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+3]]:10: error: name `b` not found + // CHECK:STDERR: fail_derive_from_final.carbon:[[@LINE+3]]:10: error(NameNotFound): name `b` not found // CHECK:STDERR: return (*p).b; // CHECK:STDERR: ^~~~~~ return (*p).b; diff --git a/toolchain/check/testdata/class/fail_base_method_define.carbon b/toolchain/check/testdata/class/fail_base_method_define.carbon index 51d68b2dee45b..80a5f13043fa4 100644 --- a/toolchain/check/testdata/class/fail_base_method_define.carbon +++ b/toolchain/check/testdata/class/fail_base_method_define.carbon @@ -20,13 +20,13 @@ class D { extend base: B; } -// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+4]]:6: error: out-of-line declaration requires a declaration in scoped entity +// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+4]]:6: error(QualifiedDeclOutsideScopeEntity): out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn D.F() {} // CHECK:STDERR: ^ // CHECK:STDERR: fn D.F() {} -// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+3]]:6: error: name `C` not found +// CHECK:STDERR: fail_base_method_define.carbon:[[@LINE+3]]:6: error(NameNotFound): name `C` not found // CHECK:STDERR: fn D.C.F() {} // CHECK:STDERR: ^ fn D.C.F() {} diff --git a/toolchain/check/testdata/class/fail_base_misplaced.carbon b/toolchain/check/testdata/class/fail_base_misplaced.carbon index 8885e7cdd68da..5bcc672a17107 100644 --- a/toolchain/check/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/check/testdata/class/fail_base_misplaced.carbon @@ -10,18 +10,18 @@ base class B {} -// CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+4]]:1: error: `base` declaration outside class +// CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+4]]:1: error(ClassSpecificDeclOutsideClass): `base` declaration outside class // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: extend base: B; fn F() { - // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+7]]:3: error: expected expression + // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+7]]:3: error(ExpectedExpr): expected expression // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error: semantics TODO: `HandleInvalidParse` + // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error(SemanticsTodo): semantics TODO: `HandleInvalidParse` // CHECK:STDERR: extend base: B; // CHECK:STDERR: ^~~~~~ extend base: B; diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index 7374c79834afa..522d61c6b8385 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -11,7 +11,7 @@ base class B {} class C1 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: error: `private` not allowed on `base` declaration + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: error(ModifierNotAllowedOnDeclaration): `private` not allowed on `base` declaration // CHECK:STDERR: private extend base: B; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -19,11 +19,11 @@ class C1 { } class C2 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+8]]:3: error: `abstract` not allowed on `base` declaration + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+8]]:3: error(ModifierNotAllowedOnDeclaration): `abstract` not allowed on `base` declaration // CHECK:STDERR: abstract base: B; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: error: missing `extend` before `base` declaration + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: error(BaseMissingExtend): missing `extend` before `base` declaration // CHECK:STDERR: abstract base: B; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,10 +31,10 @@ class C2 { } class C3 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+7]]:10: error: `default` not allowed on declaration with `extend` + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+7]]:10: error(ModifierNotAllowedWith): `default` not allowed on declaration with `extend` // CHECK:STDERR: extend default base: B; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: note: `extend` previously appeared here + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+4]]:3: note(ModifierPrevious): `extend` previously appeared here // CHECK:STDERR: extend default base: B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -42,10 +42,10 @@ class C3 { } class C4 { - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+6]]:10: error: `extend` repeated on declaration + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+6]]:10: error(ModifierRepeated): `extend` repeated on declaration // CHECK:STDERR: extend extend base: B; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+3]]:3: note: `extend` previously appeared here + // CHECK:STDERR: fail_base_modifiers.carbon:[[@LINE+3]]:3: note(ModifierPrevious): `extend` previously appeared here // CHECK:STDERR: extend extend base: B; // CHECK:STDERR: ^~~~~~ extend extend base: B; diff --git a/toolchain/check/testdata/class/fail_base_no_extend.carbon b/toolchain/check/testdata/class/fail_base_no_extend.carbon index 62b12e313c9ec..5a2a343547c55 100644 --- a/toolchain/check/testdata/class/fail_base_no_extend.carbon +++ b/toolchain/check/testdata/class/fail_base_no_extend.carbon @@ -11,7 +11,7 @@ base class B {} class C { - // CHECK:STDERR: fail_base_no_extend.carbon:[[@LINE+3]]:3: error: missing `extend` before `base` declaration + // CHECK:STDERR: fail_base_no_extend.carbon:[[@LINE+3]]:3: error(BaseMissingExtend): missing `extend` before `base` declaration // CHECK:STDERR: base: B; // CHECK:STDERR: ^~~~~~~~ base: B; diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index 46a8d45c33729..5c581adba69e0 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -13,10 +13,10 @@ base class B2 {} class C { extend base: B1; - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+7]]:3: error: multiple `base` declarations in class; multiple inheritance is not permitted + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+7]]:3: error(BaseDeclRepeated): multiple `base` declarations in class; multiple inheritance is not permitted // CHECK:STDERR: extend base: B2; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: note: previous `base` declaration is here + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: note(ClassSpecificDeclPrevious): previous `base` declaration is here // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -26,10 +26,10 @@ class C { class D { // TODO: Consider adding a custom diagnostic for this case. extend base: B1; - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+6]]:3: error: multiple `base` declarations in class; multiple inheritance is not permitted + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE+6]]:3: error(BaseDeclRepeated): multiple `base` declarations in class; multiple inheritance is not permitted // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: note: previous `base` declaration is here + // CHECK:STDERR: fail_base_repeated.carbon:[[@LINE-4]]:3: note(ClassSpecificDeclPrevious): previous `base` declaration is here // CHECK:STDERR: extend base: B1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ extend base: B1; diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index 27f08be7142d5..6abb3e3abb4e8 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -14,7 +14,7 @@ class C { extend base: B; } -// CHECK:STDERR: fail_base_unbound.carbon:[[@LINE+3]]:12: error: expression cannot be used as a value +// CHECK:STDERR: fail_base_unbound.carbon:[[@LINE+3]]:12: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: let b: B = C.base; // CHECK:STDERR: ^~~~~~ let b: B = C.base; diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 755e83e0f89e6..82708a674e89e 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -17,10 +17,10 @@ class B { } fn AccessBInA(a: A) -> i32 { - // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `A` to `B` + // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+6]]:10: error(ImplicitAsConversionFailure): cannot implicitly convert from `A` to `B` // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: note: type `A` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_compound_type_mismatch.carbon:[[@LINE+3]]:10: note(MissingImplInMemberAccessNote): type `A` does not implement interface `ImplicitAs` // CHECK:STDERR: return a.(B.b); // CHECK:STDERR: ^~~~~~~ return a.(B.b); diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index e0906b56b20ea..226e6161c36e1 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_convert_to_invalid.carbon class C { - // CHECK:STDERR: fail_convert_to_invalid.carbon:[[@LINE+3]]:10: error: name `NoSuchType` not found + // CHECK:STDERR: fail_convert_to_invalid.carbon:[[@LINE+3]]:10: error(NameNotFound): name `NoSuchType` not found // CHECK:STDERR: var a: NoSuchType; // CHECK:STDERR: ^~~~~~~~~~ var a: NoSuchType; diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index a820b3c4457e8..b3bcebebe961a 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -21,10 +21,10 @@ class B2 { var b: i32; } -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+7]]:38: error: cannot implicitly convert from `B2*` to `A1*` +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+7]]:38: error(ImplicitAsConversionFailure): cannot implicitly convert from `B2*` to `A1*` // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: note: type `B2*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+4]]:38: note(MissingImplInMemberAccessNote): type `B2*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertUnrelated(p: B2*) -> A1* { return p; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -32,10 +32,10 @@ fn ConvertUnrelated(p: B2*) -> A1* { return p; } class Incomplete; -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+6]]:47: error: cannot implicitly convert from `Incomplete*` to `A2*` +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+6]]:47: error(ImplicitAsConversionFailure): cannot implicitly convert from `Incomplete*` to `A2*` // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: note: type `Incomplete*` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_derived_to_base.carbon:[[@LINE+3]]:47: note(MissingImplInMemberAccessNote): type `Incomplete*` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDERR: ^~~~~~~~~ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } diff --git a/toolchain/check/testdata/class/fail_extend_cycle.carbon b/toolchain/check/testdata/class/fail_extend_cycle.carbon index d20081bf872a0..fd4c9d94c71cb 100644 --- a/toolchain/check/testdata/class/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/fail_extend_cycle.carbon @@ -16,16 +16,16 @@ base class B { extend base: A; } -// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+7]]:1: error: redefinition of `class A` +// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+7]]:1: error(RedeclRedef): redefinition of `class A` // CHECK:STDERR: base class A { // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE-11]]:1: note: previously defined here +// CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE-11]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: base class A { // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: base class A { extend base: A; - // CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+3]]:10: error: name `C` not found + // CHECK:STDERR: fail_extend_cycle.carbon:[[@LINE+3]]:10: error(NameNotFound): name `C` not found // CHECK:STDERR: var c: C; // CHECK:STDERR: ^ var c: C; diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 37bbffbc063d1..bf7769686e9b1 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -10,25 +10,25 @@ class Class { - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed on `var` declaration + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error(ModifierNotAllowedOnDeclaration): `default` not allowed on `var` declaration // CHECK:STDERR: default var j: i32; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default var j: i32; - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error: `final` not allowed on `var` declaration + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error(ModifierNotAllowedOnDeclaration): `final` not allowed on `var` declaration // CHECK:STDERR: final var k: i32; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: final var k: i32; - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed; requires interface scope + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+4]]:3: error(ModifierRequiresInterface): `default` not allowed; requires interface scope // CHECK:STDERR: default let l: i32 = 0; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default let l: i32 = 0; - // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+3]]:3: error: `final` not allowed; requires interface scope + // CHECK:STDERR: fail_field_modifiers.carbon:[[@LINE+3]]:3: error(ModifierRequiresInterface): `final` not allowed; requires interface scope // CHECK:STDERR: final let m: i32 = 1; // CHECK:STDERR: ^~~~~ final let m: i32 = 1; diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index 8d3e17041268d..f67baa73de7ea 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -15,18 +15,18 @@ class Class(T:! type) { // TODO: The follow-on errors here aren't great. Investigate whether we can // enter the scope anyway if the parameters don't match. -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+14]]:10: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+14]]:10: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE-10]]:13: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: class Class(T:! type) { // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+7]]:27: error: name `Self` not found +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+7]]:27: error(NameNotFound): name `Self` not found // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+3]]:36: error: name `T` not found +// CHECK:STDERR: fail_generic_method.carbon:[[@LINE+3]]:36: error(NameNotFound): name `T` not found // CHECK:STDERR: fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDERR: ^ fn Class(N:! i32).F[self: Self](n: T) {} diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 9f24c12c74252..4797f8c20b74e 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -23,22 +23,22 @@ library "[[@TEST_NAME]]"; import library "a"; -// CHECK:STDERR: fail_b.carbon:[[@LINE+8]]:1: error: redeclaration of `class Empty` is redundant +// CHECK:STDERR: fail_b.carbon:[[@LINE+8]]:1: error(RedeclRedundant): redeclaration of `class Empty` is redundant // CHECK:STDERR: class Empty { // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: a.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: a.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: class Empty { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: class Empty { } -// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:8: error: variable has incomplete type `Incomplete` +// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:8: error(IncompleteTypeInVarDecl): variable has incomplete type `Incomplete` // CHECK:STDERR: var a: Incomplete; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_b.carbon:[[@LINE-16]]:1: in import -// CHECK:STDERR: a.carbon:7:1: note: class was forward declared here +// CHECK:STDERR: fail_b.carbon:[[@LINE-16]]:1(InImport): in import +// CHECK:STDERR: a.carbon:7:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var a: Incomplete; diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 0e34c615e9447..68a2a98a62b66 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -10,49 +10,49 @@ class Class; -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:4: error: cannot declare a member of incomplete class `Class` +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:4: error(QualifiedDeclInIncompleteClassScope): cannot declare a member of incomplete class `Class` // CHECK:STDERR: fn Class.Function() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-5]]:1: note: class was forward declared here +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-5]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fn Class.Function() {} fn CallClassFunction() { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:3: error: member access into incomplete class `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:3: error(QualifiedExprInIncompleteClassScope): member access into incomplete class `Class` // CHECK:STDERR: Class.Function(); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-15]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-15]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: Class.Function(); } -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:17: error: variable has incomplete type `Class` +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:17: error(IncompleteTypeInVarDecl): variable has incomplete type `Class` // CHECK:STDERR: var global_var: Class; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-25]]:1: note: class was forward declared here +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-25]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: var global_var: Class; -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:24: error: function returns incomplete type `Class` +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:24: error(IncompleteTypeInFunctionReturnType): function returns incomplete type `Class` // CHECK:STDERR: fn ConvertFromStruct() -> Class { return {}; } // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-34]]:1: note: class was forward declared here +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-34]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fn ConvertFromStruct() -> Class { return {}; } fn G(p: Class*) -> i32 { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error: member access into object of incomplete type `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error(IncompleteTypeInMemberAccess): member access into object of incomplete type `Class` // CHECK:STDERR: return p->n; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-44]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-44]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -60,20 +60,20 @@ fn G(p: Class*) -> i32 { } fn MemberAccess(p: Class*) -> i32 { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:11: error: member access into object of incomplete type `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:11: error(IncompleteTypeInMemberAccess): member access into object of incomplete type `Class` // CHECK:STDERR: return (*p).n; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-55]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-55]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: return (*p).n; } -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:20: error: function returns incomplete type `Class` +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:20: error(IncompleteTypeInFunctionReturnType): function returns incomplete type `Class` // CHECK:STDERR: fn Copy(p: Class*) -> Class { // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-65]]:1: note: class was forward declared here +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-65]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -82,10 +82,10 @@ fn Copy(p: Class*) -> Class { } fn Let(p: Class*) { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error: `let` binding has incomplete type `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error(IncompleteTypeInLetDecl): `let` binding has incomplete type `Class` // CHECK:STDERR: let c: Class = *p; // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-77]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-77]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: @@ -97,25 +97,25 @@ fn TakeIncomplete(c: Class); fn ReturnIncomplete() -> Class; fn CallTakeIncomplete(p: Class*) { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:18: error: forming value of incomplete type `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:18: error(IncompleteTypeInValueConversion): forming value of incomplete type `Class` // CHECK:STDERR: TakeIncomplete(*p); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-92]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-92]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-11]]:19: note: initializing function parameter + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-11]]:19: note(InCallToFunctionParam): initializing function parameter // CHECK:STDERR: fn TakeIncomplete(c: Class); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: TakeIncomplete(*p); - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:18: error: forming value of incomplete type `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+10]]:18: error(IncompleteTypeInValueConversion): forming value of incomplete type `Class` // CHECK:STDERR: TakeIncomplete({}); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-104]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-104]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-23]]:19: note: initializing function parameter + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-23]]:19: note(InCallToFunctionParam): initializing function parameter // CHECK:STDERR: fn TakeIncomplete(c: Class); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -123,13 +123,13 @@ fn CallTakeIncomplete(p: Class*) { } fn CallReturnIncomplete() { - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+9]]:3: error: function returns incomplete type `Class` + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE+9]]:3: error(IncompleteTypeInFunctionReturnType): function returns incomplete type `Class` // CHECK:STDERR: ReturnIncomplete(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-118]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-118]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-35]]:23: note: return type declared here + // CHECK:STDERR: fail_incomplete.carbon:[[@LINE-35]]:23: note(IncompleteReturnTypeHere): return type declared here // CHECK:STDERR: fn ReturnIncomplete() -> Class; // CHECK:STDERR: ^~~~~~~~ ReturnIncomplete(); diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index 4d68df1d8f64a..fa3e47094817e 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -14,17 +14,17 @@ class Class { } fn F() { - // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: error: cannot initialize class with 2 fields from struct with 1 field + // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: error(StructInitElementCountMismatch): cannot initialize class with 2 fields from struct with 1 field // CHECK:STDERR: {.a = 1} as Class; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: {.a = 1} as Class; - // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: error: missing value for field `b` in struct initialization + // CHECK:STDERR: fail_init.carbon:[[@LINE+4]]:3: error(StructInitMissingFieldInLiteral): missing value for field `b` in struct initialization // CHECK:STDERR: {.a = 1, .c = 2} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: {.a = 1, .c = 2} as Class; - // CHECK:STDERR: fail_init.carbon:[[@LINE+3]]:3: error: cannot initialize class with 2 fields from struct with 3 fields + // CHECK:STDERR: fail_init.carbon:[[@LINE+3]]:3: error(StructInitElementCountMismatch): cannot initialize class with 2 fields from struct with 3 fields // CHECK:STDERR: {.a = 1, .b = 2, .c = 3} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ {.a = 1, .b = 2, .c = 3} as Class; diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index e97be14416e38..2d9f1e660783f 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -19,7 +19,7 @@ fn F() { // TODO: This case should presumably work: `{...} as Class` should be an // initializing expression, not a value expression. // - // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+3]]:18: error: cannot copy value of type `Class` + // CHECK:STDERR: fail_init_as_inplace.carbon:[[@LINE+3]]:18: error(CopyOfUncopyableType): cannot copy value of type `Class` // CHECK:STDERR: var c: Class = {.a = 1, .b = 2} as Class; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ var c: Class = {.a = 1, .b = 2} as Class; diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 352bbc47decf1..694ca24525981 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -18,10 +18,10 @@ class B { fn F(s: {.a: A}, b: B) { // `s` has only a value representation, so this must be invalid. - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+7]]:4: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+7]]:4: error(AddrSelfIsNonRef): `addr self` method cannot be invoked on a value // CHECK:STDERR: s.a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:8: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-12]]:8: note(InCallToFunctionSelf): initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: A*](); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -29,10 +29,10 @@ fn F(s: {.a: A}, b: B) { // `b` has an object representation for `A`, but this is still invalid for // consistency. - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+6]]:4: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE+6]]:4: error(AddrSelfIsNonRef): `addr self` method cannot be invoked on a value // CHECK:STDERR: b.a.F(); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:8: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_memaccess_category.carbon:[[@LINE-23]]:8: note(InCallToFunctionSelf): initializing `addr self` parameter of method declared here // CHECK:STDERR: fn F[addr self: A*](); // CHECK:STDERR: ^~~~~~~~~~~~~ b.a.F(); diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index 00465c569962f..ed7e04a525b35 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -17,10 +17,10 @@ let T: type = Class; // The class name is required to be written in the same way as in the class // declaration. An expression that evaluates to the class name is not accepted. -// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+6]]:4: error: name qualifiers are only allowed for entities that provide a scope +// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE+6]]:4: error(QualifiedNameInNonScope): name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn T.F() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE-7]]:5: note: referenced non-scope entity declared here +// CHECK:STDERR: fail_member_of_let.carbon:[[@LINE-7]]:5: note(QualifiedNameNonScopeEntity): referenced non-scope entity declared here // CHECK:STDERR: let T: type = Class; // CHECK:STDERR: ^ fn T.F() {} diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index 05baebfb17f4d..e1b0d3f5ed8d8 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -20,27 +20,27 @@ fn F(c: Class) { c.WithSelf(); Class.NoSelf(); - // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: missing object argument in method call + // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error(MissingObjectInMethodCall): missing object argument in method call // CHECK:STDERR: Class.WithSelf(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-13]]:3: note: calling function declared here + // CHECK:STDERR: fail_method.carbon:[[@LINE-13]]:3: note(InCallToFunction): calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Class.WithSelf(); - // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error: 1 argument passed to function expecting 0 arguments + // CHECK:STDERR: fail_method.carbon:[[@LINE+7]]:3: error(CallArgCountMismatch): 1 argument passed to function expecting 0 arguments // CHECK:STDERR: Class.WithSelf(c); // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-21]]:3: note: calling function declared here + // CHECK:STDERR: fail_method.carbon:[[@LINE-21]]:3: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Class.WithSelf(c); - // CHECK:STDERR: fail_method.carbon:[[@LINE+6]]:3: error: missing object argument in method call + // CHECK:STDERR: fail_method.carbon:[[@LINE+6]]:3: error(MissingObjectInMethodCall): missing object argument in method call // CHECK:STDERR: A(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_method.carbon:[[@LINE-30]]:3: note: calling function declared here + // CHECK:STDERR: fail_method.carbon:[[@LINE-30]]:3: note(InCallToFunction): calling function declared here // CHECK:STDERR: fn WithSelf[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ A(); diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index e32da14a51a4b..c3fb1aa08ae5a 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -10,19 +10,19 @@ class FinalClass { - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `abstract` not allowed; requires `abstract` class scope + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error(ModifierAbstractNotAllowed): `abstract` not allowed; requires `abstract` class scope // CHECK:STDERR: abstract fn Abstract[self: Self](); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note: containing definition here + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note(ModifierNotInContext): containing definition here // CHECK:STDERR: class FinalClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: abstract fn Abstract[self: Self](); - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error: `virtual` not allowed; requires `abstract` or `base` class scope + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+7]]:3: error(ModifierVirtualNotAllowed): `virtual` not allowed; requires `abstract` or `base` class scope // CHECK:STDERR: virtual fn Virtual[self: Self](); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-14]]:1: note: containing definition here + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-14]]:1: note(ModifierNotInContext): containing definition here // CHECK:STDERR: class FinalClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,13 +31,13 @@ class FinalClass { abstract class AbstractClass { - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: error: `default` not allowed; requires interface scope + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: error(ModifierRequiresInterface): `default` not allowed; requires interface scope // CHECK:STDERR: default fn Default[self: Self](); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn Default[self: Self](); - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: error: `final` not allowed; requires interface scope + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+4]]:3: error(ModifierRequiresInterface): `final` not allowed; requires interface scope // CHECK:STDERR: final fn Final[self: Self](); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -46,10 +46,10 @@ abstract class AbstractClass { base class BaseClass { - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+6]]:3: error: `abstract` not allowed; requires `abstract` class scope + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE+6]]:3: error(ModifierAbstractNotAllowed): `abstract` not allowed; requires `abstract` class scope // CHECK:STDERR: abstract fn Abstract[self: Self](); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note: containing definition here + // CHECK:STDERR: fail_method_modifiers.carbon:[[@LINE-5]]:1: note(ModifierNotInContext): containing definition here // CHECK:STDERR: base class BaseClass { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ abstract fn Abstract[self: Self](); diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index 65a5f8eaed802..47015a0e0e62a 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -10,10 +10,10 @@ class Class { fn F() {} - // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE+6]]:3: error: redefinition of `fn F` + // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE+6]]:3: error(RedeclRedef): redefinition of `fn F` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE-4]]:3: note: previously defined here + // CHECK:STDERR: fail_method_redefinition.carbon:[[@LINE-4]]:3: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ fn F() {} diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index 45a6391b74ef4..3db37cedf6f73 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -8,89 +8,89 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `private` repeated on declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error(ModifierRepeated): `private` repeated on declaration // CHECK:STDERR: private private class DuplicatePrivate; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `private` previously appeared here // CHECK:STDERR: private private class DuplicatePrivate; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private private class DuplicatePrivate; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `abstract` not allowed on `class` forward declaration, only definition +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierOnlyAllowedOnDefinition): `abstract` not allowed on `class` forward declaration, only definition // CHECK:STDERR: abstract class AbstractDecl; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract class AbstractDecl; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` not allowed on declaration with `private` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error(ModifierNotAllowedWith): `protected` not allowed on declaration with `private` // CHECK:STDERR: private protected class TwoAccess; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `private` previously appeared here // CHECK:STDERR: private protected class TwoAccess; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private protected class TwoAccess; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `base` not allowed on `class` forward declaration, only definition +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierOnlyAllowedOnDefinition): `base` not allowed on `class` forward declaration, only definition // CHECK:STDERR: base class BaseDecl; // CHECK:STDERR: ^~~~ // CHECK:STDERR: base class BaseDecl; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `abstract` repeated on declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error(ModifierRepeated): `abstract` repeated on declaration // CHECK:STDERR: abstract abstract class TwoAbstract { } // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: abstract abstract class TwoAbstract { } // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract abstract class TwoAbstract { } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+15]]:1: error: `protected` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+15]]:1: error(ModifierProtectedNotAllowed): `protected` not allowed; requires class scope // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:11: error: `virtual` not allowed on `class` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:11: error(ModifierNotAllowedOnDeclaration): `virtual` not allowed on `class` declaration // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:19: error: `base` not allowed on declaration with `virtual` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:19: error(ModifierNotAllowedWith): `base` not allowed on declaration with `virtual` // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:11: note: `virtual` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:11: note(ModifierPrevious): `virtual` previously appeared here // CHECK:STDERR: protected virtual base class Virtual {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: protected virtual base class Virtual {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `protected` must appear before `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error(ModifierMustAppearBefore): `protected` must appear before `abstract` // CHECK:STDERR: abstract protected class WrongOrder { } // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: abstract protected class WrongOrder { } // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract protected class WrongOrder { } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `base` not allowed on declaration with `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error(ModifierNotAllowedWith): `base` not allowed on declaration with `abstract` // CHECK:STDERR: abstract base class AbstractAndBase {} // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: abstract base class AbstractAndBase {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract base class AbstractAndBase {} abstract class AbstractWithDefinition { - // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:19: error: definition of `abstract` function + // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:19: error(DefinedAbstractFunction): definition of `abstract` function // CHECK:STDERR: abstract fn F() {} // CHECK:STDERR: ^ // CHECK:STDERR: abstract fn F() {} abstract fn G(); } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:31: error: definition of `abstract` function +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:31: error(DefinedAbstractFunction): definition of `abstract` function // CHECK:STDERR: fn AbstractWithDefinition.G() { // CHECK:STDERR: ^ fn AbstractWithDefinition.G() { diff --git a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon index 0073586dda023..2823844bac2b3 100644 --- a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon +++ b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon @@ -10,7 +10,7 @@ class C {} -// CHECK:STDERR: fail_out_of_line_decl.carbon:[[@LINE+3]]:6: error: out-of-line declaration requires a declaration in scoped entity +// CHECK:STDERR: fail_out_of_line_decl.carbon:[[@LINE+3]]:6: error(QualifiedDeclOutsideScopeEntity): out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn C.F() {} // CHECK:STDERR: ^ fn C.F() {} diff --git a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon index 62ca87fb78798..f06dad93b9e0b 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon @@ -19,7 +19,7 @@ class X { class A { class B; } class Y { - // CHECK:STDERR: fail_redeclaration_scope.carbon:[[@LINE+3]]:9: error: name `A` not found + // CHECK:STDERR: fail_redeclaration_scope.carbon:[[@LINE+3]]:9: error(NameNotFound): name `A` not found // CHECK:STDERR: class A.B {} // CHECK:STDERR: ^ class A.B {} diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index 63a9c0983c4c1..a97fd0afd19ff 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -14,10 +14,10 @@ class Class { fn I() {} } -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:1: error: redefinition of `class Class` +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:1: error(RedeclRedef): redefinition of `class Class` // CHECK:STDERR: class Class { // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-9]]:1: note: previously defined here +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-9]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: class Class { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -28,16 +28,16 @@ class Class { } fn Class.F() {} -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+4]]:10: error: out-of-line declaration requires a declaration in scoped entity +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+4]]:10: error(QualifiedDeclOutsideScopeEntity): out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn Class.G() {} // CHECK:STDERR: ^ // CHECK:STDERR: fn Class.G() {} fn Class.H() {} -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `fn I` +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error(RedeclRedef): redefinition of `fn I` // CHECK:STDERR: fn Class.I() {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-26]]:3: note: previously defined here +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-26]]:3: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn I() {} // CHECK:STDERR: ^~~~~~~~ fn Class.I() {} diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index df99da487c498..3367056659f65 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -15,7 +15,7 @@ class Class { } fn G() -> i32 { - // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: error: name `F` not found + // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: error(NameNotFound): name `F` not found // CHECK:STDERR: return F(); // CHECK:STDERR: ^ return F(); diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 03114f240aa7a..be471276d24a9 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_self.carbon class Class { - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:8: error: `self` can only be declared in an implicit parameter list + // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:8: error(SelfOutsideImplicitParamList): `self` can only be declared in an implicit parameter list // CHECK:STDERR: fn F(self: Self); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ class Class { fn G() -> Self; } -// CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:12: error: `self` can only be declared in an implicit parameter list +// CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:12: error(SelfOutsideImplicitParamList): `self` can only be declared in an implicit parameter list // CHECK:STDERR: fn Class.F(self: Self) { // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -26,12 +26,12 @@ fn Class.F(self: Self) { } fn Class.G() -> Self { - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:7: error: `self` can only be declared in an implicit parameter list + // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:7: error(SelfOutsideImplicitParamList): `self` can only be declared in an implicit parameter list // CHECK:STDERR: var self: Self; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: var self: Self; - // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:10: error: cannot copy value of type `Class` + // CHECK:STDERR: fail_self.carbon:[[@LINE+4]]:10: error(CopyOfUncopyableType): cannot copy value of type `Class` // CHECK:STDERR: return self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -43,13 +43,13 @@ class WrongSelf { } fn CallWrongSelf(ws: WrongSelf) { - // CHECK:STDERR: fail_self.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `WrongSelf` to `Class` + // CHECK:STDERR: fail_self.carbon:[[@LINE+9]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `WrongSelf` to `Class` // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: note: type `WrongSelf` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_self.carbon:[[@LINE+6]]:3: note(MissingImplInMemberAccessNote): type `WrongSelf` does not implement interface `ImplicitAs` // CHECK:STDERR: ws.F(); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: note: initializing `self` parameter of method declared here + // CHECK:STDERR: fail_self.carbon:[[@LINE-10]]:8: note(InCallToFunctionSelf): initializing `self` parameter of method declared here // CHECK:STDERR: fn F[self: Class](); // CHECK:STDERR: ^~~~~~~~~~~ ws.F(); diff --git a/toolchain/check/testdata/class/fail_self_param.carbon b/toolchain/check/testdata/class/fail_self_param.carbon index 4eeb64d01b46f..c6566cebb7d35 100644 --- a/toolchain/check/testdata/class/fail_self_param.carbon +++ b/toolchain/check/testdata/class/fail_self_param.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_self_param.carbon -// CHECK:STDERR: fail_self_param.carbon:[[@LINE+3]]:9: error: `self` parameter only allowed on functions +// CHECK:STDERR: fail_self_param.carbon:[[@LINE+3]]:9: error(SelfParameterNotAllowed): `self` parameter only allowed on functions // CHECK:STDERR: class C[self:! type](x:! self) {} // CHECK:STDERR: ^~~~~~~~~~~ class C[self:! type](x:! self) {} diff --git a/toolchain/check/testdata/class/fail_self_type_member.carbon b/toolchain/check/testdata/class/fail_self_type_member.carbon index b6f37df71e37b..15d183b5b85b9 100644 --- a/toolchain/check/testdata/class/fail_self_type_member.carbon +++ b/toolchain/check/testdata/class/fail_self_type_member.carbon @@ -14,11 +14,11 @@ class Class { fn F() -> bool { var c1: Class = {.b = true}; - // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+7]]:17: error: expected identifier after `.` + // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+7]]:17: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: var c2: Class.Self = c1; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+3]]:17: error: semantics TODO: `Error recovery from keyword name.` + // CHECK:STDERR: fail_self_type_member.carbon:[[@LINE+3]]:17: error(SemanticsTodo): semantics TODO: `Error recovery from keyword name.` // CHECK:STDERR: var c2: Class.Self = c1; // CHECK:STDERR: ^~~~ var c2: Class.Self = c1; diff --git a/toolchain/check/testdata/class/fail_todo_local_class.carbon b/toolchain/check/testdata/class/fail_todo_local_class.carbon index 2c5110254d501..8e9755a4da826 100644 --- a/toolchain/check/testdata/class/fail_todo_local_class.carbon +++ b/toolchain/check/testdata/class/fail_todo_local_class.carbon @@ -11,11 +11,11 @@ // TODO: Support parsing classes at function scope. class A { fn F() { - // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+7]]:5: error: expected expression + // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+7]]:5: error(ExpectedExpr): expected expression // CHECK:STDERR: class B { // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+3]]:5: error: semantics TODO: `HandleInvalidParse` + // CHECK:STDERR: fail_todo_local_class.carbon:[[@LINE+3]]:5: error(SemanticsTodo): semantics TODO: `HandleInvalidParse` // CHECK:STDERR: class B { // CHECK:STDERR: ^~~~~ class B { diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 3e89f59755b68..fdc93059256bf 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -11,7 +11,7 @@ class Class { var field: i32; fn F() -> i32 { - // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+4]]:12: error: expression cannot be used as a value + // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+4]]:12: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: return field; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -20,7 +20,7 @@ class Class { } fn G() -> i32 { - // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+3]]:10: error: expression cannot be used as a value + // CHECK:STDERR: fail_unbound_field.carbon:[[@LINE+3]]:10: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: return Class.field; // CHECK:STDERR: ^~~~~~~~~~~ return Class.field; diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index ce63bb75ffc5a..a702cb635f881 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -14,7 +14,7 @@ class Class { fn G(c: Class) -> i32 { // TODO: Mention the scope in which we looked for the name. - // CHECK:STDERR: fail_unknown_member.carbon:[[@LINE+3]]:10: error: name `something` not found + // CHECK:STDERR: fail_unknown_member.carbon:[[@LINE+3]]:10: error(NameNotFound): name `something` not found // CHECK:STDERR: return c.something; // CHECK:STDERR: ^~~~~~~~~~~ return c.something; diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 93dde31955239..faeb6b9249442 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -25,10 +25,10 @@ library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} -// CHECK:STDERR: fail_too_few.carbon:[[@LINE+7]]:8: error: 1 argument passed to generic class expecting 2 arguments +// CHECK:STDERR: fail_too_few.carbon:[[@LINE+7]]:8: error(CallArgCountMismatch): 1 argument passed to generic class expecting 2 arguments // CHECK:STDERR: var a: Class(i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_too_few.carbon:[[@LINE-5]]:1: note: calling generic class declared here +// CHECK:STDERR: fail_too_few.carbon:[[@LINE-5]]:1: note(InCallToEntity): calling generic class declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -40,10 +40,10 @@ library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} -// CHECK:STDERR: fail_too_many.carbon:[[@LINE+7]]:8: error: 3 arguments passed to generic class expecting 2 arguments +// CHECK:STDERR: fail_too_many.carbon:[[@LINE+7]]:8: error(CallArgCountMismatch): 3 arguments passed to generic class expecting 2 arguments // CHECK:STDERR: var a: Class(i32*, 1, 2); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_too_many.carbon:[[@LINE-5]]:1: note: calling generic class declared here +// CHECK:STDERR: fail_too_many.carbon:[[@LINE-5]]:1: note(InCallToEntity): calling generic class declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -55,13 +55,13 @@ library "[[@TEST_NAME]]"; class Class(T:! type, N:! i32) {} -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+9]]:8: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE+6]]:8: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var a: Class(5, i32*); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:1: note: while deducing parameters of generic declared here +// CHECK:STDERR: fail_no_conversion.carbon:[[@LINE-8]]:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: class Class(T:! type, N:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var a: Class(5, i32*); diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 7db7f22dbdf44..fead98dca4504 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -55,10 +55,10 @@ import library "foo"; fn Use() { // TODO: Include the generic arguments in the formatted type name. - // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `CompleteClass` to `CompleteClass` + // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+7]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `CompleteClass` to `CompleteClass` // CHECK:STDERR: var v: CompleteClass(i32*) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: note: type `CompleteClass` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_generic_arg_mismatch.carbon:[[@LINE+4]]:3: note(MissingImplInMemberAccessNote): type `CompleteClass` does not implement interface `ImplicitAs` // CHECK:STDERR: var v: CompleteClass(i32*) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -69,16 +69,16 @@ fn Use() { impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+8]]:13: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+8]]:13: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: class Class(U:! type) { // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: foo.carbon:4:13: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: foo.carbon:4:13: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: class Class(T:! type); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: class Class(U:! type) { - // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+3]]:10: error: name `T` not found + // CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+3]]:10: error(NameNotFound): name `T` not found // CHECK:STDERR: var x: T; // CHECK:STDERR: ^ var x: T; diff --git a/toolchain/check/testdata/class/generic/member_access.carbon b/toolchain/check/testdata/class/generic/member_access.carbon index dc278a2e45072..d806791f87d2c 100644 --- a/toolchain/check/testdata/class/generic/member_access.carbon +++ b/toolchain/check/testdata/class/generic/member_access.carbon @@ -39,10 +39,10 @@ class Class(T:! type) { } fn StaticMemberFunctionCall(T:! type) -> Class(T) { - // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `Class` to `Class` + // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+6]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `Class` to `Class` // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: note: type `Class` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_static_member_fn_call.carbon:[[@LINE+3]]:3: note(MissingImplInMemberAccessNote): type `Class` does not implement interface `ImplicitAs` // CHECK:STDERR: return Class(T).Make(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ return Class(T).Make(); diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index 743d6fced923d..cc0a0886141c1 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -30,7 +30,7 @@ library "fail_member_inline.carbon"; class C(T:! type) { fn F() { - // CHECK:STDERR: fail_member_inline.carbon:[[@LINE+3]]:5: error: expression cannot be used as a value + // CHECK:STDERR: fail_member_inline.carbon:[[@LINE+3]]:5: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: data; // CHECK:STDERR: ^~~~ data; diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index 79021daede58b..b3b38b157bf21 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -46,10 +46,10 @@ class NotGeneric { fn F(); } -// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter list +// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE+7]]:4: error(RedeclParamListDiffers): redeclaration differs because of parameter list // CHECK:STDERR: fn NotGeneric(T:! type).F() {} // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE-7]]:1: note: previously declared without parameter list +// CHECK:STDERR: fail_mismatched_not_generic_vs_generic.carbon:[[@LINE-7]]:1: note(RedeclParamListPrevious): previously declared without parameter list // CHECK:STDERR: class NotGeneric { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -63,10 +63,10 @@ class Generic(T:! type) { fn TooFew(); } -// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 0 +// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE+7]]:4: error(RedeclParamCountDiffers): redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn Generic().TooFew() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE-7]]:1: note: previously declared with parameter count of 1 +// CHECK:STDERR: fail_mismatched_too_few_args.carbon:[[@LINE-7]]:1: note(RedeclParamCountPrevious): previously declared with parameter count of 1 // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -80,10 +80,10 @@ class Generic(T:! type) { fn TooMany(); } -// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE+7]]:4: error: redeclaration differs because of parameter count of 2 +// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE+7]]:4: error(RedeclParamCountDiffers): redeclaration differs because of parameter count of 2 // CHECK:STDERR: fn Generic(T:! type, U:! type).TooMany() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE-7]]:1: note: previously declared with parameter count of 1 +// CHECK:STDERR: fail_mismatched_too_many_args.carbon:[[@LINE-7]]:1: note(RedeclParamCountPrevious): previously declared with parameter count of 1 // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -97,10 +97,10 @@ class Generic(T:! type) { fn WrongType(); } -// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+6]]:12: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE+6]]:12: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: fn Generic(T:! ()).WrongType() {} // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_mismatched_wrong_arg_type.carbon:[[@LINE-7]]:15: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: class Generic(T:! type) { // CHECK:STDERR: ^~~~~~~~ fn Generic(T:! ()).WrongType() {} diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 0bab4e6962a53..0817e1e9e8a08 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -22,10 +22,10 @@ class Generic(T:! type) { library "[[@TEST_NAME]]"; class A; -// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter list +// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE+7]]:1: error(RedeclParamListDiffers): redeclaration differs because of parameter list // CHECK:STDERR: class A(T:! type) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE-4]]:1: note: previously declared without parameter list +// CHECK:STDERR: fail_mismatch_param_list.carbon:[[@LINE-4]]:1: note(RedeclParamListPrevious): previously declared without parameter list // CHECK:STDERR: class A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -36,10 +36,10 @@ class A(T:! type) {} library "[[@TEST_NAME]]"; class B(N:! i32); -// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE+7]]:1: error: redeclaration differs because of implicit parameter list +// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE+7]]:1: error(RedeclParamListDiffers): redeclaration differs because of implicit parameter list // CHECK:STDERR: class B[T:! type](N:! T) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE-4]]:1: note: previously declared without implicit parameter list +// CHECK:STDERR: fail_mismatch_implicit_param_list.carbon:[[@LINE-4]]:1: note(RedeclParamListPrevious): previously declared without implicit parameter list // CHECK:STDERR: class B(N:! i32); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -50,10 +50,10 @@ class B[T:! type](N:! T) {} library "[[@TEST_NAME]]"; class C(T:! type); -// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 2 +// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE+7]]:1: error(RedeclParamCountDiffers): redeclaration differs because of parameter count of 2 // CHECK:STDERR: class C(T:! type, U:! i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 1 +// CHECK:STDERR: fail_mismatch_param_count.carbon:[[@LINE-4]]:1: note(RedeclParamCountPrevious): previously declared with parameter count of 1 // CHECK:STDERR: class C(T:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -64,10 +64,10 @@ class C(T:! type, U:! i32) {} library "[[@TEST_NAME]]"; class D(T:! type); -// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE+7]]:9: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: class D(T:! i32) {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_mismatch_param_type.carbon:[[@LINE-4]]:9: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: class D(T:! type); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -78,10 +78,10 @@ class D(T:! i32) {} library "[[@TEST_NAME]]"; class E(T:! type); -// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+6]]:9: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE+6]]:9: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: class E(U:! type) {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE-4]]:9: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_mismatch_param_name.carbon:[[@LINE-4]]:9: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: class E(T:! type); // CHECK:STDERR: ^~~~~~~~ class E(U:! type) {} diff --git a/toolchain/check/testdata/class/inheritance_access.carbon b/toolchain/check/testdata/class/inheritance_access.carbon index 244fcaa063600..066384d217d0a 100644 --- a/toolchain/check/testdata/class/inheritance_access.carbon +++ b/toolchain/check/testdata/class/inheritance_access.carbon @@ -79,10 +79,10 @@ class Square { extend base: Shape; fn GetPosition[self: Self]() -> i32 { - // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE+7]]:12: error: cannot access private member `y` of type `Shape` + // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE+7]]:12: error(ClassInvalidMemberAccess): cannot access private member `y` of type `Shape` // CHECK:STDERR: return self.y; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE-10]]:15: note: declared here + // CHECK:STDERR: fail_inherited_private_field_access.carbon:[[@LINE-10]]:15: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private var y: i32; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -118,10 +118,10 @@ base class B { class C { extend base: B; - // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE+7]]:12: error: cannot access private member `F` of type `B` + // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE+7]]:12: error(ClassInvalidMemberAccess): cannot access private member `F` of type `B` // CHECK:STDERR: fn G() { Self.F(); } // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE-8]]:3: note: declared here + // CHECK:STDERR: fail_noninstance_private_on_parent.carbon:[[@LINE-8]]:3: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -158,19 +158,19 @@ class B { private var internal: Internal; fn G() -> i32 { - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:5: error: cannot access private member `SOME_PRIVATE_CONSTANT` of type `A` + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:5: error(ClassInvalidMemberAccess): cannot access private member `SOME_PRIVATE_CONSTANT` of type `A` // CHECK:STDERR: A.SOME_PRIVATE_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-14]]:15: note: declared here + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-14]]:15: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private let SOME_PRIVATE_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: A.SOME_PRIVATE_CONSTANT; - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error: cannot access protected member `SOME_PROTECTED_CONSTANT` of type `A` + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error(ClassInvalidMemberAccess): cannot access protected member `SOME_PROTECTED_CONSTANT` of type `A` // CHECK:STDERR: return A.SOME_PROTECTED_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-24]]:17: note: declared here + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-24]]:17: note(ClassMemberDeclaration): declared here // CHECK:STDERR: protected let SOME_PROTECTED_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -178,10 +178,10 @@ class B { } fn SomeFunc[self: Self]() -> i32{ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error: cannot access protected member `INTERNAL_CONSTANT` of type `Internal` + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE+7]]:12: error(ClassInvalidMemberAccess): cannot access protected member `INTERNAL_CONSTANT` of type `Internal` // CHECK:STDERR: return self.internal.INTERNAL_CONSTANT; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-30]]:17: note: declared here + // CHECK:STDERR: fail_non_inherited_access.carbon:[[@LINE-30]]:17: note(ClassMemberDeclaration): declared here // CHECK:STDERR: protected let INTERNAL_CONSTANT: i32 = 5; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -200,10 +200,10 @@ base class A { class B { extend base: A; fn F[self: Self]() { - // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE+6]]:11: error: cannot access private member `x` of type `A` + // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE+6]]:11: error(ClassInvalidMemberAccess): cannot access private member `x` of type `A` // CHECK:STDERR: self.(A.x); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE-9]]:15: note: declared here + // CHECK:STDERR: fail_compound_member_access.carbon:[[@LINE-9]]:15: note(ClassMemberDeclaration): declared here // CHECK:STDERR: private var x: i32; // CHECK:STDERR: ^~~~~~ self.(A.x); diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index 0acf3d72b0115..1b471a524a7c5 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -52,19 +52,19 @@ let a: C = {.a = 1, .b = 2}; // Cannot implicitly convert between a type and an adapter for the type. -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C` to `AdaptC` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error(ImplicitAsConversionFailure): cannot implicitly convert from `C` to `AdaptC` // CHECK:STDERR: let b: AdaptC = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `C` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note(MissingImplInMemberAccessNote): type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: let b: AdaptC = a; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ // CHECK:STDERR: let b: AdaptC = a; -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `AdaptC` to `C` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error(ImplicitAsConversionFailure): cannot implicitly convert from `AdaptC` to `C` // CHECK:STDERR: let c: C = b; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note(MissingImplInMemberAccessNote): type `` does not implement interface `ImplicitAs` // CHECK:STDERR: let c: C = b; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -74,19 +74,19 @@ fn MakeC() -> C; fn MakeAdaptC() -> AdaptC; -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C` to `AdaptC` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+7]]:1: error(ImplicitAsConversionFailure): cannot implicitly convert from `C` to `AdaptC` // CHECK:STDERR: var d: AdaptC = MakeC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note: type `C` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+4]]:1: note(MissingImplInMemberAccessNote): type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var d: AdaptC = MakeC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var d: AdaptC = MakeC(); -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `AdaptC` to `C` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+6]]:1: error(ImplicitAsConversionFailure): cannot implicitly convert from `AdaptC` to `C` // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: note: type `AdaptC` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_not_implicit.carbon:[[@LINE+3]]:1: note(MissingImplInMemberAccessNote): type `AdaptC` does not implement interface `ImplicitAs` // CHECK:STDERR: var e: C = MakeAdaptC(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ var e: C = MakeAdaptC(); diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/no_prelude/extern.carbon index 88b42705e53d2..66a6bb0f2db99 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern.carbon @@ -45,10 +45,10 @@ class C {} library "[[@TEST_NAME]]"; extern class C; -// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE+7]]:4: error: cannot declare a member of incomplete class `C` +// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE+7]]:4: error(QualifiedDeclInIncompleteClassScope): cannot declare a member of incomplete class `C` // CHECK:STDERR: fn C.F(); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE-4]]:1: note: class was forward declared here +// CHECK:STDERR: fail_decl_fn_in_extern.carbon:[[@LINE-4]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -65,10 +65,10 @@ extern class C {} library "[[@TEST_NAME]]"; extern class C; -// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant +// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_extern_decl_after_extern_decl.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -79,10 +79,10 @@ extern class C; library "[[@TEST_NAME]]"; extern class C; -// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant +// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `class C` is redundant // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_decl_after_extern_decl.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -93,7 +93,7 @@ class C; library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_extern_member_class.carbon:[[@LINE+4]]:3: error: `extern` not allowed; requires file or namespace scope + // CHECK:STDERR: fail_extern_member_class.carbon:[[@LINE+4]]:3: error(ModifierExternNotAllowed): `extern` not allowed; requires file or namespace scope // CHECK:STDERR: extern class D; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -105,10 +105,10 @@ class C { library "[[@TEST_NAME]]"; extern class C; -// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE+7]]:1: error: redeclarations of `class C` must match use of `extern` +// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE+7]]:1: error(RedeclExternMismatch): redeclarations of `class C` must match use of `extern` // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_def_after_extern_decl.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -119,10 +119,10 @@ class C {} library "[[@TEST_NAME]]"; class C; -// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE+7]]:1: error: redeclaration of `class C` is redundant +// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_extern_decl_after_decl.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -132,12 +132,12 @@ extern class C; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: decl.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+9]]:1(InImport): in import +// CHECK:STDERR: decl.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_import_extern_decl_then_decl.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: extern_decl.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -148,12 +148,12 @@ import library "decl"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: extern_decl.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+9]]:1(InImport): in import +// CHECK:STDERR: extern_decl.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: decl.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_import_decl_then_extern_decl.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: decl.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -164,12 +164,12 @@ import library "extern_decl"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: def.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+9]]:1(InImport): in import +// CHECK:STDERR: def.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_import_extern_decl_then_def.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: extern_decl.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -180,21 +180,21 @@ import library "def"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+18]]:1: in import -// CHECK:STDERR: decl.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+18]]:1(InImport): in import +// CHECK:STDERR: decl.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+14]]:1: in import -// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+14]]:1(InImport): in import +// CHECK:STDERR: extern_decl.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: def.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+9]]:1(InImport): in import +// CHECK:STDERR: def.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_import_ownership_conflict.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: extern_decl.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -206,12 +206,12 @@ import library "def"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: extern_decl_copy.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+9]]:1(InImport): in import +// CHECK:STDERR: extern_decl_copy.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: extern_decl.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_todo_import_extern_decl_copy.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: extern_decl.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -224,11 +224,11 @@ library "[[@TEST_NAME]]"; import library "extern_decl"; -// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE+8]]:1: error: redeclaration of `class C` is redundant +// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE+8]]:1: error(RedeclRedundant): redeclaration of `class C` is redundant // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: extern_decl.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: extern_decl.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -240,11 +240,11 @@ library "[[@TEST_NAME]]"; import library "decl"; -// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE+8]]:1: error: redeclarations of `class C` must match use of `extern` +// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: decl.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: decl.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -256,11 +256,11 @@ library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE+8]]:1: error: redeclarations of `class C` must match use of `extern` +// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: def.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: def.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -272,11 +272,11 @@ library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+7]]:1: error: redeclarations of `class C` must match use of `extern` +// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+7]]:1: error(RedeclExternMismatch): redeclarations of `class C` must match use of `extern` // CHECK:STDERR: extern class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: def.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: def.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ extern class C; diff --git a/toolchain/check/testdata/class/no_prelude/extern_library.carbon b/toolchain/check/testdata/class/no_prelude/extern_library.carbon index 6c2b06e7fc118..3f877e0d554b5 100644 --- a/toolchain/check/testdata/class/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/class/no_prelude/extern_library.carbon @@ -10,7 +10,7 @@ // --- fail_todo.carbon -// CHECK:STDERR: fail_todo.carbon:[[@LINE+3]]:1: error: semantics TODO: `extern library` +// CHECK:STDERR: fail_todo.carbon:[[@LINE+3]]:1: error(SemanticsTodo): semantics TODO: `extern library` // CHECK:STDERR: extern library "foo" class C; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extern library "foo" class C; diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon index 1b8f9effd0e5c..9249ef98f4cc0 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon @@ -33,7 +33,7 @@ var e: C(X).GenericAndParams(X) = {}; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:9: error: parameters of generic types must be constant +// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:9: error(GenericParamMustBeConstant): parameters of generic types must be constant // CHECK:STDERR: class A[T: type]() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -43,7 +43,7 @@ class A[T: type]() {} library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:9: error: parameters of generic types must be constant +// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:9: error(GenericParamMustBeConstant): parameters of generic types must be constant // CHECK:STDERR: class A(T: type) {} // CHECK:STDERR: ^~~~~~~ class A(T: type) {} diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon index f22faffbd1420..540ef0c52a84b 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/no_prelude/implicit_import.carbon @@ -30,11 +30,11 @@ class C {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+8]]:1: error: redeclaration of `class C` is redundant +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+8]]:1: error(RedeclRedundant): redeclaration of `class C` is redundant // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: redecl_after_def.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: redecl_after_def.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -50,11 +50,11 @@ class C {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+8]]:1: error: redefinition of `class C` +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+8]]:1: error(RedeclRedef): redefinition of `class C` // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: redef_after_def.carbon:4:1: note: previously defined here +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: redef_after_def.carbon:4:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: class C {} // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -71,11 +71,11 @@ alias B = C; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: class B {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: def_alias.carbon:5:7: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: alias B = C; // CHECK:STDERR: ^ class B {} diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 945d7f8546ebe..20106a448a1a6 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -48,7 +48,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:8: error: name `Def` not found +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:8: error(NameNotFound): name `Def` not found // CHECK:STDERR: var c: Def = {}; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -60,7 +60,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:8: error: name `Def` not found +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:8: error(NameNotFound): name `Def` not found // CHECK:STDERR: var c: Test.Def = {}; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -78,7 +78,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; -// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:8: error: name `ForwardWithDef` not found +// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:8: error(NameNotFound): name `ForwardWithDef` not found // CHECK:STDERR: var c: ForwardWithDef = {}; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:8: error: name `ForwardWithDef` not found +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:8: error(NameNotFound): name `ForwardWithDef` not found // CHECK:STDERR: var c: Test.ForwardWithDef = {}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -110,7 +110,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward"; -// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found +// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error(NameNotFound): name `Forward` not found // CHECK:STDERR: fn F(c: Forward*) {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -122,7 +122,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error: name `Forward` not found +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error(NameNotFound): name `Forward` not found // CHECK:STDERR: fn F(c: Test.Forward*) {} // CHECK:STDERR: ^~~~~~~~~~~~ fn F(c: Test.Forward*) {} diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon index 12630a9ea8aa8..7ed4810b22f14 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon @@ -52,7 +52,7 @@ class C; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file +// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error(MissingDefinitionInImpl): no definition found for declaration in impl file // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -66,7 +66,7 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error(MissingDefinitionInImpl): no definition found for declaration in impl file // CHECK:STDERR: class D; // CHECK:STDERR: ^~~~~~~~ class D; diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon index 79be8fe75c470..f50c0b3b0dc11 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon @@ -37,10 +37,10 @@ library "[[@TEST_NAME]]"; class C {} class Foo(a:! C); -// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here +// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:15: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:15: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -80,10 +80,10 @@ class C {} alias D = C; class Foo(a:! C); -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:11: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:11: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: class Foo(b:! D) {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:11: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:11: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -97,10 +97,10 @@ class C {} alias D = C; class Foo(a:! C); -// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here +// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:15: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:15: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: class Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -114,10 +114,10 @@ class C {} alias D = C; class Foo[a:! C](); -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:15: error: redeclaration syntax differs here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:15: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: class Foo[a:! D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:15: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: class Foo[a:! C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -146,14 +146,14 @@ library "[[@TEST_NAME]]"; class C {} class Foo(a:! const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:15: warning: `const` applied repeatedly to the same type has no additional effect +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:15: warning(RepeatedConst): `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: class Foo(a:! const (const C)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:21: error: redeclaration syntax differs here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:21: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: class Foo(a:! const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:21: note: comparing with previous declaration here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:21: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: class Foo(a:! const C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -169,10 +169,10 @@ base class Base { fn F[addr self: Self*](); } -// CHECK:STDERR: fail_self_type.carbon:[[@LINE+6]]:22: error: redeclaration syntax differs here +// CHECK:STDERR: fail_self_type.carbon:[[@LINE+6]]:22: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: fn Base.F[addr self: Base*]() { // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:19: note: comparing with previous declaration here +// CHECK:STDERR: fail_self_type.carbon:[[@LINE-6]]:19: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: fn F[addr self: Self*](); // CHECK:STDERR: ^~~~ fn Base.F[addr self: Base*]() { diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 7d11b351c8451..b0f525ac0370b 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -32,17 +32,17 @@ fn Class.G[addr self: Self*]() -> i32 { library "[[@TEST_NAME]]"; class Class { - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+13]]:25: error: invalid use of incomplete type `Class` + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+13]]:25: error(IncompleteTypeInConversion): invalid use of incomplete type `Class` // CHECK:STDERR: fn F[self: Self]() -> self; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE-4]]:1: note: class is incomplete within its definition + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE-4]]:1: note(ClassIncompleteWithinDefinition): class is incomplete within its definition // CHECK:STDERR: class Class { // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+6]]:25: error: cannot implicitly convert from `Class` to `type` + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+6]]:25: error(ImplicitAsConversionFailure): cannot implicitly convert from `Class` to `type` // CHECK:STDERR: fn F[self: Self]() -> self; // CHECK:STDERR: ^~~~ - // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+3]]:25: note: type `` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_return_self_value.carbon:[[@LINE+3]]:25: note(MissingImplInMemberAccessNote): type `` does not implement interface `ImplicitAs` // CHECK:STDERR: fn F[self: Self]() -> self; // CHECK:STDERR: ^~~~ fn F[self: Self]() -> self; diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index e4f751f44f656..aed712deb0cb5 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -7,7 +7,7 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/syntactic_merge_literal.carbon -// CHECK:STDERR: fail_int_mismatch.carbon: error: `Main//default` previously provided by `int_match.carbon` +// CHECK:STDERR: fail_int_mismatch.carbon: error(DuplicateMainApi): `Main//default` previously provided by `int_match.carbon` // CHECK:STDERR: // --- int_match.carbon @@ -20,10 +20,10 @@ class D(b:! C(1_000)) {} class C(a:! i32) {} class D(b:! C(1000)); -// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+6]]:15: error: redeclaration syntax differs here +// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE+6]]:15: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: class D(b:! C(1_000)) {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: note: comparing with previous declaration here +// CHECK:STDERR: fail_int_mismatch.carbon:[[@LINE-4]]:15: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: class D(b:! C(1000)); // CHECK:STDERR: ^~~~ class D(b:! C(1_000)) {} diff --git a/toolchain/check/testdata/class/virtual_modifiers.carbon b/toolchain/check/testdata/class/virtual_modifiers.carbon index 5a7ec1d84f330..d897fd6fd4dde 100644 --- a/toolchain/check/testdata/class/virtual_modifiers.carbon +++ b/toolchain/check/testdata/class/virtual_modifiers.carbon @@ -45,7 +45,7 @@ import Modifiers; fn F() { // TODO: The vptr shouldn't be counted for programmer-facing behavior. - // CHECK:STDERR: fail_todo_init.carbon:[[@LINE+3]]:27: error: cannot initialize class with 1 field from struct with 0 fields + // CHECK:STDERR: fail_todo_init.carbon:[[@LINE+3]]:27: error(StructInitElementCountMismatch): cannot initialize class with 1 field from struct with 0 fields // CHECK:STDERR: var v: Modifiers.Base = {}; // CHECK:STDERR: ^~ var v: Modifiers.Base = {}; diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 2a38732e671f4..9ffaa5bdbb2f1 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/const/collapse.carbon // OK, `const (const i32)` is the same type as `const i32`. -// CHECK:STDERR: collapse.carbon:[[@LINE+3]]:25: warning: `const` applied repeatedly to the same type has no additional effect +// CHECK:STDERR: collapse.carbon:[[@LINE+3]]:25: warning(RepeatedConst): `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: fn F(p: const i32**) -> const (const i32)** { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ fn F(p: const i32**) -> const (const i32)** { diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index bacc4c76aeb9f..2db778dbd4138 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -8,15 +8,15 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/const/fail_collapse.carbon -// CHECK:STDERR: fail_collapse.carbon:[[@LINE+4]]:9: warning: `const` applied repeatedly to the same type has no additional effect +// CHECK:STDERR: fail_collapse.carbon:[[@LINE+4]]:9: warning(RepeatedConst): `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: fn G(p: const (const i32)**) -> i32** { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn G(p: const (const i32)**) -> i32** { - // CHECK:STDERR: fail_collapse.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const i32**` to `i32**` + // CHECK:STDERR: fail_collapse.carbon:[[@LINE+6]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `const i32**` to `i32**` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: note: type `const i32**` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_collapse.carbon:[[@LINE+3]]:3: note(MissingImplInMemberAccessNote): type `const i32**` does not implement interface `ImplicitAs` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ return p; diff --git a/toolchain/check/testdata/deduce/array.carbon b/toolchain/check/testdata/deduce/array.carbon index 7cdb189bfa4b6..6c070bc6ba021 100644 --- a/toolchain/check/testdata/deduce/array.carbon +++ b/toolchain/check/testdata/deduce/array.carbon @@ -27,7 +27,7 @@ library "[[@TEST_NAME]]"; class C {} -// CHECK:STDERR: fail_todo_bound_only.carbon:[[@LINE+4]]:22: error: semantics TODO: `symbolic array bound` +// CHECK:STDERR: fail_todo_bound_only.carbon:[[@LINE+4]]:22: error(SemanticsTodo): semantics TODO: `symbolic array bound` // CHECK:STDERR: fn F[N:! i32](a: [C; N]) -> i32 { return N; } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -44,7 +44,7 @@ library "[[@TEST_NAME]]"; class C {} -// CHECK:STDERR: fail_todo_type_and_bound.carbon:[[@LINE+4]]:32: error: semantics TODO: `symbolic array bound` +// CHECK:STDERR: fail_todo_type_and_bound.carbon:[[@LINE+4]]:32: error(SemanticsTodo): semantics TODO: `symbolic array bound` // CHECK:STDERR: fn F[T:! type, N:! i32](a: [T; N]) -> T; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -66,13 +66,13 @@ fn F[T:! type](a: [T; 2]) -> T { return a[0]; } fn G() -> C { // TODO: We succeed at deducing T here but fail to convert. Is this the right behavior? var a: [C; 3] = ({}, {}, {}); - // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+10]]:12: error: cannot implicitly convert from `[C; 3]` to `[C; 2]` + // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+10]]:12: error(ImplicitAsConversionFailure): cannot implicitly convert from `[C; 3]` to `[C; 2]` // CHECK:STDERR: return F(a); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+7]]:12: note: type `[C; 3]` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+7]]:12: note(MissingImplInMemberAccessNote): type `[C; 3]` does not implement interface `ImplicitAs` // CHECK:STDERR: return F(a); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE-11]]:16: note: initializing function parameter + // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE-11]]:16: note(InCallToFunctionParam): initializing function parameter // CHECK:STDERR: fn F[T:! type](a: [T; 2]) -> T { return a[0]; } // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -86,7 +86,7 @@ library "[[@TEST_NAME]]"; class C {} class D {} -// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:22: error: semantics TODO: `symbolic array bound` +// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:22: error(SemanticsTodo): semantics TODO: `symbolic array bound` // CHECK:STDERR: fn F[N:! i32](a: [C; N]) -> i32 { return N; } // CHECK:STDERR: ^ fn F[N:! i32](a: [C; N]) -> i32 { return N; } diff --git a/toolchain/check/testdata/deduce/int_float.carbon b/toolchain/check/testdata/deduce/int_float.carbon index e10136fd4abf8..41c8dc4e0dc30 100644 --- a/toolchain/check/testdata/deduce/int_float.carbon +++ b/toolchain/check/testdata/deduce/int_float.carbon @@ -25,7 +25,7 @@ fn G(a: i64) -> i32 { library "[[@TEST_NAME]]"; // TODO: This should pass once we accept symbolic widths for Core.Float. -// CHECK:STDERR: fail_todo_float.carbon:[[@LINE+3]]:18: error: cannot evaluate type expression +// CHECK:STDERR: fail_todo_float.carbon:[[@LINE+3]]:18: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: fn F[N:! i32](n: Core.Float(N)) -> i32 { // CHECK:STDERR: ^~~~~~~~~~~~~ fn F[N:! i32](n: Core.Float(N)) -> i32 { diff --git a/toolchain/check/testdata/deduce/tuple.carbon b/toolchain/check/testdata/deduce/tuple.carbon index 41d7fd77806c8..7642a8596c03a 100644 --- a/toolchain/check/testdata/deduce/tuple.carbon +++ b/toolchain/check/testdata/deduce/tuple.carbon @@ -43,10 +43,10 @@ class D {} fn F[T:! type](pair: (T, T)) -> T; fn G(pair: (C, D)) -> D { - // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE+6]]:10: error: inconsistent deductions for value of generic parameter `T` + // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE+6]]:10: error(DeductionInconsistent): inconsistent deductions for value of generic parameter `T` // CHECK:STDERR: return F(pair); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here + // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE-6]]:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: fn F[T:! type](pair: (T, T)) -> T; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return F(pair); diff --git a/toolchain/check/testdata/deduce/type_operator.carbon b/toolchain/check/testdata/deduce/type_operator.carbon index 234d352dff3b9..365afe8d97ced 100644 --- a/toolchain/check/testdata/deduce/type_operator.carbon +++ b/toolchain/check/testdata/deduce/type_operator.carbon @@ -53,10 +53,10 @@ class C {} fn F[T:! type](p: const T*) -> T { return F(p); } fn G(p: C*) -> const C { - // CHECK:STDERR: fail_const_from_nonconst.carbon:[[@LINE+6]]:10: error: cannot deduce value for generic parameter `T` + // CHECK:STDERR: fail_const_from_nonconst.carbon:[[@LINE+6]]:10: error(DeductionIncomplete): cannot deduce value for generic parameter `T` // CHECK:STDERR: return F(p); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_const_from_nonconst.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here + // CHECK:STDERR: fail_const_from_nonconst.carbon:[[@LINE-6]]:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: fn F[T:! type](p: const T*) -> T { return F(p); } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return F(p); diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index bded80a92f13a..72736c6905306 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -10,7 +10,7 @@ // TODO: This creates an array temporary, which we don't yet support evaluating. -// CHECK:STDERR: fail_aggregate.carbon:[[@LINE+3]]:43: error: array bound is not a constant +// CHECK:STDERR: fail_aggregate.carbon:[[@LINE+3]]:43: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 51ad6c6e52f45..c7a416fbeb07a 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -10,7 +10,7 @@ // TODO: This should work. fn G(N:! i32) { - // CHECK:STDERR: fail_symbolic.carbon:[[@LINE+3]]:16: error: semantics TODO: `symbolic array bound` + // CHECK:STDERR: fail_symbolic.carbon:[[@LINE+3]]:16: error(SemanticsTodo): semantics TODO: `symbolic array bound` // CHECK:STDERR: var k: [i32; N]; // CHECK:STDERR: ^ var k: [i32; N]; diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index d2e915ccc7284..e54b98b480c0b 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -9,30 +9,30 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_redefined.carbon fn A(n: i32, m: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn A` +// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error(RedeclRedef): redefinition of `fn A` // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 { return n; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn A(n: i32, m: i32) -> i32 { return n; } fn B(n: i32, m: i32) -> i32 { return n; } -// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn B` +// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error(RedeclRedef): redefinition of `fn B` // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 { return n; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn B(n: i32, m: i32) -> i32 = "int.sadd"; fn C(n: i32, m: i32) -> i32 = "int.sadd"; -// CHECK:STDERR: fail_redefined.carbon:[[@LINE+6]]:1: error: redefinition of `fn C` +// CHECK:STDERR: fail_redefined.carbon:[[@LINE+6]]:1: error(RedeclRedef): redefinition of `fn C` // CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here +// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn C(n: i32, m: i32) -> i32 = "int.sadd"; diff --git a/toolchain/check/testdata/function/builtin/fail_unknown.carbon b/toolchain/check/testdata/function/builtin/fail_unknown.carbon index 926f5bb773af1..7b82f0699845d 100644 --- a/toolchain/check/testdata/function/builtin/fail_unknown.carbon +++ b/toolchain/check/testdata/function/builtin/fail_unknown.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_unknown.carbon -// CHECK:STDERR: fail_unknown.carbon:[[@LINE+3]]:23: error: unknown builtin function name "unknown.builtin.name" +// CHECK:STDERR: fail_unknown.carbon:[[@LINE+3]]:23: error(UnknownBuiltinFunctionName): unknown builtin function name "unknown.builtin.name" // CHECK:STDERR: fn UnknownBuiltin() = "unknown.builtin.name"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ fn UnknownBuiltin() = "unknown.builtin.name"; diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index 797a93d26c327..799cbe13780c2 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_not_callable.carbon fn Run() { - // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: error: value of type `String` is not callable + // CHECK:STDERR: fail_not_callable.carbon:[[@LINE+3]]:16: error(CallToNonCallable): value of type `String` is not callable // CHECK:STDERR: var x: i32 = "hello"(); // CHECK:STDERR: ^~~~~~~~ var x: i32 = "hello"(); diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index 584b26f5173de..9fa320698a870 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -13,52 +13,52 @@ fn Run1(a: i32) {} fn Run2(a: i32, b: i32) {} fn Main() { - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument passed to function expecting 0 arguments + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error(CallArgCountMismatch): 1 argument passed to function expecting 0 arguments // CHECK:STDERR: Run0(1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: note: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn Run0() {} // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: Run0(1); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 arguments passed to function expecting 0 arguments + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error(CallArgCountMismatch): 2 arguments passed to function expecting 0 arguments // CHECK:STDERR: Run0(0, 1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: note: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn Run0() {} // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: Run0(0, 1); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 1 argument + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error(CallArgCountMismatch): 0 arguments passed to function expecting 1 argument // CHECK:STDERR: Run1(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: note: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn Run1(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run1(); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 arguments passed to function expecting 1 argument + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error(CallArgCountMismatch): 2 arguments passed to function expecting 1 argument // CHECK:STDERR: Run1(0, 1); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: note: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn Run1(a: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run1(0, 1); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 2 arguments + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error(CallArgCountMismatch): 0 arguments passed to function expecting 2 arguments // CHECK:STDERR: Run2(); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: note: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn Run2(a: i32, b: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: Run2(); - // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: error: 1 argument passed to function expecting 2 arguments + // CHECK:STDERR: fail_param_count.carbon:[[@LINE+6]]:3: error(CallArgCountMismatch): 1 argument passed to function expecting 2 arguments // CHECK:STDERR: Run2(0); // CHECK:STDERR: ^~~~~ - // CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: note: calling function declared here + // CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn Run2(a: i32, b: i32) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ Run2(0); diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index d11eeb00dd690..145d661c06140 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -11,13 +11,13 @@ fn G(a: i32) {} fn F() { - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:5: error: cannot implicitly convert from `f64` to `i32` + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+9]]:5: error(ImplicitAsConversionFailure): cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:5: note: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_param_type.carbon:[[@LINE+6]]:5: note(MissingImplInMemberAccessNote): type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: G(1.0); // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:6: note: initializing function parameter + // CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:6: note(InCallToFunctionParam): initializing function parameter // CHECK:STDERR: fn G(a: i32) {} // CHECK:STDERR: ^~~~~~ G(1.0); diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index b54ba3f8138c1..f97cdf7021692 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -11,10 +11,10 @@ fn Foo() -> f64 { return 1.0; } fn Run() { - // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` + // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+6]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3: note(MissingImplInMemberAccessNote): type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: i32 = Foo(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ var x: i32 = Foo(); diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon b/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon index f6becaee7a44f..5b317aa2764d1 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon -// CHECK:STDERR: fail_explicit_self_param.carbon:[[@LINE+3]]:6: error: `self` can only be declared in an implicit parameter list +// CHECK:STDERR: fail_explicit_self_param.carbon:[[@LINE+3]]:6: error(SelfOutsideImplicitParamList): `self` can only be declared in an implicit parameter list // CHECK:STDERR: fn F(self: ()); // CHECK:STDERR: ^~~~~~~~ fn F(self: ()); diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon b/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon index 7f2978f791faf..3d6b99ca97623 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon +++ b/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon -// CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+3]]:6: error: implicit parameters of functions must be constant or `self` +// CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+3]]:6: error(ImplictParamMustBeConstant): implicit parameters of functions must be constant or `self` // CHECK:STDERR: fn F[s: ()](); // CHECK:STDERR: ^ fn F[s: ()](); diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index af00fbe88f730..60a7aca366eb0 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_in_type.carbon -// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+3]]:23: error: array bound is not a constant +// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+3]]:23: error(InvalidArrayExpr): array bound is not a constant // CHECK:STDERR: fn F(n: i32, a: [i32; n]*); // CHECK:STDERR: ^ fn F(n: i32, a: [i32; n]*); diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index e8ef91619ff20..bb2c8ff47de8d 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_redecl.carbon -// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+6]]:14: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+6]]:14: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+3]]:6: note: name is previously declared here +// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+3]]:6: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn F(n: i32, n: i32); // CHECK:STDERR: ^ fn F(n: i32, n: i32); diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index f0f51f3c385f8..908cbaca3c1ad 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -58,47 +58,47 @@ library "[[@TEST_NAME]]"; import library "api"; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: api.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: api.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: extern fn A(); -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn B` must match use of `extern` +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn B` must match use of `extern` // CHECK:STDERR: extern fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-14]]:1: in import -// CHECK:STDERR: api.carbon:5:1: note: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-14]]:1(InImport): in import +// CHECK:STDERR: api.carbon:5:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extern fn B(b: i32) -> i32; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn C` must match use of `extern` +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn C` must match use of `extern` // CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-23]]:1: in import -// CHECK:STDERR: api.carbon:6:1: note: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-23]]:1(InImport): in import +// CHECK:STDERR: api.carbon:6:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32}; -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclaration of `fn D` is redundant +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error(RedeclRedundant): redeclaration of `fn D` is redundant // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-32]]:1: in import -// CHECK:STDERR: api.carbon:7:1: note: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-32]]:1(InImport): in import +// CHECK:STDERR: api.carbon:7:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: extern fn D(); -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn E` must match use of `extern` +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn E` must match use of `extern` // CHECK:STDERR: extern fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-41]]:1: in import -// CHECK:STDERR: api.carbon:10:1: note: previously declared here +// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-41]]:1(InImport): in import +// CHECK:STDERR: api.carbon:10:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -132,48 +132,48 @@ var e: () = NS.E(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_merge.carbon:[[@LINE+45]]:1: in import -// CHECK:STDERR: extern_api.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge.carbon:[[@LINE+45]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+41]]:1: in import -// CHECK:STDERR: api.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+41]]:1(InImport): in import +// CHECK:STDERR: api.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+36]]:1: in import -// CHECK:STDERR: extern_api.carbon:5:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge.carbon:[[@LINE+36]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:5:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+32]]:1: in import -// CHECK:STDERR: api.carbon:5:1: note: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+32]]:1(InImport): in import +// CHECK:STDERR: api.carbon:5:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+27]]:1: in import -// CHECK:STDERR: extern_api.carbon:6:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge.carbon:[[@LINE+27]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:6:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+23]]:1: in import -// CHECK:STDERR: api.carbon:6:1: note: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+23]]:1(InImport): in import +// CHECK:STDERR: api.carbon:6:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+18]]:1: in import -// CHECK:STDERR: extern_api.carbon:7:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge.carbon:[[@LINE+18]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:7:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+14]]:1: in import -// CHECK:STDERR: api.carbon:7:1: note: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+14]]:1(InImport): in import +// CHECK:STDERR: api.carbon:7:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: extern_api.carbon:10:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge.carbon:[[@LINE+9]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:10:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern library "redecl_extern_api" fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: api.carbon:10:1: note: name is previously declared here +// CHECK:STDERR: fail_merge.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: api.carbon:10:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -190,48 +190,48 @@ var e: () = NS.E(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+44]]:1: in import -// CHECK:STDERR: api.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+44]]:1(InImport): in import +// CHECK:STDERR: api.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+40]]:1: in import -// CHECK:STDERR: extern_api.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+40]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+35]]:1: in import -// CHECK:STDERR: api.carbon:5:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+35]]:1(InImport): in import +// CHECK:STDERR: api.carbon:5:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+31]]:1: in import -// CHECK:STDERR: extern_api.carbon:5:1: note: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+31]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:5:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+26]]:1: in import -// CHECK:STDERR: api.carbon:6:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+26]]:1(InImport): in import +// CHECK:STDERR: api.carbon:6:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+22]]:1: in import -// CHECK:STDERR: extern_api.carbon:6:1: note: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+22]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:6:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+17]]:1: in import -// CHECK:STDERR: api.carbon:7:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+17]]:1(InImport): in import +// CHECK:STDERR: api.carbon:7:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+13]]:1: in import -// CHECK:STDERR: extern_api.carbon:7:1: note: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+13]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:7:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: api.carbon:10:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: api.carbon:10:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: extern_api.carbon:10:1: note: name is previously declared here +// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: extern_api.carbon:10:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern library "redecl_extern_api" fn NS.E(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ import library "extern_api"; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon index 1f07140e8173c..b48f334be449d 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon @@ -25,10 +25,10 @@ var x: () = F(); library "[[@TEST_NAME]]"; extern fn F(); -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `fn F` is redundant // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -39,10 +39,10 @@ extern fn F(); library "[[@TEST_NAME]]"; extern fn F(); -// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant +// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `fn F` is redundant // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -53,12 +53,12 @@ fn F(); library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: error: `extern` not allowed; requires file or namespace scope + // CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: error(ModifierExternNotAllowed): `extern` not allowed; requires file or namespace scope // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: extern fn F(); - // CHECK:STDERR: fail_member_extern.carbon:[[@LINE+3]]:3: error: `extern` not allowed; requires file or namespace scope + // CHECK:STDERR: fail_member_extern.carbon:[[@LINE+3]]:3: error(ModifierExternNotAllowed): `extern` not allowed; requires file or namespace scope // CHECK:STDERR: extern fn G[self: Self](); // CHECK:STDERR: ^~~~~~ extern fn G[self: Self](); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon index a44ba5d824fbf..17161f8db170c 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon @@ -28,11 +28,11 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE+8]]:1: error: declaration in library "extern_library_nonowner" doesn't match `extern library` declaration +// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE+8]]:1: error(ExternLibraryIncorrect): declaration in library "extern_library_nonowner" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here +// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: extern_library.carbon:4:1: note(ExternLibraryExpected): previously declared with `extern library` here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -44,11 +44,11 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE+8]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: extern_library.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -60,11 +60,11 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+8]]:1: error: declaration in library "extern_library_redecl" doesn't match `extern library` declaration +// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+8]]:1: error(ExternLibraryIncorrect): declaration in library "extern_library_redecl" doesn't match `extern library` declaration // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here +// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: extern_library.carbon:4:1: note(ExternLibraryExpected): previously declared with `extern library` here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -80,12 +80,12 @@ extern library "extern_library_owner" fn F(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: extern_library_copy.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+9]]:1(InImport): in import +// CHECK:STDERR: extern_library_copy.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: extern_library.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: extern_library.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: extern library "extern_library_owner" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -104,7 +104,7 @@ library "[[@TEST_NAME]]"; import library "extern_library_mismatch" -// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1: error: `import` declarations must end with a `;` +// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1: error(ExpectedDeclSemi): `import` declarations must end with a `;` // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -114,7 +114,7 @@ extern fn F(); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+4]]:1: error: `extern library` cannot specify the current library +// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+4]]:1: error(ExternLibraryIsCurrentLibrary): `extern library` cannot specify the current library // CHECK:STDERR: extern library "extern_self_library" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -132,11 +132,11 @@ library "[[@TEST_NAME]]"; import library "extern_of_import"; -// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE+7]]:1: error(RedeclExternMismatch): redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: extern library "extern_of_import" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: extern_of_import.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: extern_of_import.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ extern library "extern_of_import" fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon index d8236c7e52733..cf467fbcab2ce 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon @@ -28,11 +28,11 @@ package Foo library "[[@TEST_NAME]]"; import library default; -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+7]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+7]]:1: error(ExternLibraryIncorrect): declaration in library "wrong_library" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: default.carbon:4:1: note: previously declared with `extern library` here +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: default.carbon:4:1: note(ExternLibraryExpected): previously declared with `extern library` here // CHECK:STDERR: extern library "expected" fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extern fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon index 21908fa627ab1..25b11c66d6af9 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon @@ -26,11 +26,11 @@ library "[[@TEST_NAME]]"; import library "extern_library"; -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+7]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+7]]:1: error(ExternLibraryIncorrect): declaration in library "wrong_library" doesn't match `extern library` declaration // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here +// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: extern_library.carbon:4:1: note(ExternLibraryExpected): previously declared with `extern library` here // CHECK:STDERR: extern library default fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ extern fn F(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon index fbd2f0fc8f92e..f8c0b9caccc08 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_import_incomplete_return.carbon @@ -21,24 +21,24 @@ fn ReturnDUnused() -> D; fn ReturnDUsed() -> D; fn Call() { - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `C` + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error(IncompleteTypeInFunctionReturnType): function returns incomplete type `C` // CHECK:STDERR: ReturnCUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:18: note: return type declared here + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:18: note(IncompleteReturnTypeHere): return type declared here // CHECK:STDERR: fn ReturnCUsed() -> C; // CHECK:STDERR: ^~~~ // CHECK:STDERR: ReturnCUsed(); - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `D` + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error(IncompleteTypeInFunctionReturnType): function returns incomplete type `D` // CHECK:STDERR: ReturnDUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: note: class was forward declared here + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class D; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:18: note: return type declared here + // CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:18: note(IncompleteReturnTypeHere): return type declared here // CHECK:STDERR: fn ReturnDUsed() -> D; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -54,28 +54,28 @@ library "[[@TEST_NAME]]"; import library "incomplete_return"; fn CallFAndGIncomplete() { - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error: function returns incomplete type `C` + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error(IncompleteTypeInFunctionReturnType): function returns incomplete type `C` // CHECK:STDERR: ReturnCUnused(); // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1: in import - // CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1(InImport): in import + // CHECK:STDERR: fail_incomplete_return.carbon:4:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-10]]:1: in import - // CHECK:STDERR: fail_incomplete_return.carbon:7:20: note: return type declared here + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-10]]:1(InImport): in import + // CHECK:STDERR: fail_incomplete_return.carbon:7:20: note(IncompleteReturnTypeHere): return type declared here // CHECK:STDERR: fn ReturnCUnused() -> C; // CHECK:STDERR: ^~~~ // CHECK:STDERR: ReturnCUnused(); - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+11]]:3: error: function returns incomplete type `C` + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE+11]]:3: error(IncompleteTypeInFunctionReturnType): function returns incomplete type `C` // CHECK:STDERR: ReturnCUsed(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-19]]:1: in import - // CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-19]]:1(InImport): in import + // CHECK:STDERR: fail_incomplete_return.carbon:4:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1: in import - // CHECK:STDERR: fail_incomplete_return.carbon:8:18: note: return type declared here + // CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1(InImport): in import + // CHECK:STDERR: fail_incomplete_return.carbon:8:18: note(IncompleteReturnTypeHere): return type declared here // CHECK:STDERR: fn ReturnCUsed() -> C; // CHECK:STDERR: ^~~~ ReturnCUsed(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon index 5838b573680b7..ac5d3be352087 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon @@ -8,84 +8,84 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `default` not allowed; requires interface scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error(ModifierRequiresInterface): `default` not allowed; requires interface scope // CHECK:STDERR: default protected fn WrongOrder(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` must appear before `default` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error(ModifierMustAppearBefore): `protected` must appear before `default` // CHECK:STDERR: default protected fn WrongOrder(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `default` previously appeared here // CHECK:STDERR: default protected fn WrongOrder(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default protected fn WrongOrder(); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `virtual` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error(ModifierRequiresClass): `virtual` not allowed; requires class scope // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `virtual` repeated on declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error(ModifierRepeated): `virtual` repeated on declaration // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `virtual` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `virtual` previously appeared here // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: virtual virtual fn DuplicateVirtual() {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` not allowed on declaration with `private` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error(ModifierNotAllowedWith): `protected` not allowed on declaration with `private` // CHECK:STDERR: private protected fn TwoAccess(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `private` previously appeared here // CHECK:STDERR: private protected fn TwoAccess(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private protected fn TwoAccess(); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `abstract` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error(ModifierRequiresClass): `abstract` not allowed; requires class scope // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error: `virtual` not allowed on declaration with `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:10: error(ModifierNotAllowedWith): `virtual` not allowed on declaration with `abstract` // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract virtual fn ModifiersConflict() {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `base` not allowed on `fn` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `base` not allowed on `fn` declaration // CHECK:STDERR: base fn InvalidModifier(); // CHECK:STDERR: ^~~~ // CHECK:STDERR: base fn InvalidModifier(); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: error: `default` not allowed; requires interface scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:1: error(ModifierRequiresInterface): `default` not allowed; requires interface scope // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:9: error: `final` not allowed on declaration with `default` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:9: error(ModifierNotAllowedWith): `final` not allowed on declaration with `default` // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: note(ModifierPrevious): `default` previously appeared here // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:15: error: `virtual` not allowed on declaration with `default` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:15: error(ModifierNotAllowedWith): `virtual` not allowed on declaration with `default` // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `default` previously appeared here // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default final virtual fn ModifiersConflict2() {} -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:8: error: `private` must appear before `extern` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:8: error(ModifierMustAppearBefore): `private` must appear before `extern` // CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: note: `extern` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: note(ModifierPrevious): `extern` previously appeared here // CHECK:STDERR: extern private fn ExternOrderAndConflict() {} // CHECK:STDERR: ^~~~~~ extern private fn ExternOrderAndConflict() {} diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon index e7569c43ab2d6..4af5eb5a6185e 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon @@ -8,11 +8,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon -// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+7]]:6: error: expected name in binding pattern +// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+7]]:6: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: error: semantics TODO: `Error recovery from keyword name.` +// CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+3]]:6: error(SemanticsTodo): semantics TODO: `Error recovery from keyword name.` // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); // CHECK:STDERR: ^ fn F((a: {}, b: {}), c: {}); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon index 60ef0a8ccbafa..548e6832ca974 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon @@ -9,50 +9,50 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon fn A(); -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn A` is redundant +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `fn A` is redundant // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn A(); fn B(x: ()); -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn B` is redundant +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `fn B` is redundant // CHECK:STDERR: fn B(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn B(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fn B(x: ()); fn C(); -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error(RedeclParamCountDiffers): redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn C(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 0 +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note(RedeclParamCountPrevious): previously declared with parameter count of 0 // CHECK:STDERR: fn C(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn C(x: ()); fn D() {} -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn D` is redundant +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `fn D` is redundant // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn D() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn D(); fn E() {} -// CHECK:STDERR: fail_redecl.carbon:[[@LINE+6]]:1: error: redefinition of `fn E` +// CHECK:STDERR: fail_redecl.carbon:[[@LINE+6]]:1: error(RedeclRedef): redefinition of `fn E` // CHECK:STDERR: fn E() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously defined here +// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn E() {} // CHECK:STDERR: ^~~~~~~~ fn E() {} diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon index 604662b1c5a63..d17ea5562d2e6 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon @@ -11,7 +11,7 @@ // --- fail_no_body.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_no_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` +// CHECK:STDERR: fail_no_body.carbon:[[@LINE+4]]:1: error(SemanticsTodo): semantics TODO: `function with positional parameters` // CHECK:STDERR: fn A; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -20,7 +20,7 @@ fn A; // --- fail_todo_brace_body.carbon library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` +// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+4]]:1: error(SemanticsTodo): semantics TODO: `function with positional parameters` // CHECK:STDERR: fn A { // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -31,11 +31,11 @@ fn A { // TODO: We don't have parsing support for this yet. library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+7]]:1: error: semantics TODO: `function with positional parameters` +// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+7]]:1: error(SemanticsTodo): semantics TODO: `function with positional parameters` // CHECK:STDERR: fn A => 0; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+3]]:6: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+3]]:6: error(ExpectedDeclSemiOrDefinition): `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: fn A => 0; // CHECK:STDERR: ^~ fn A => 0; diff --git a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon index caa539be113c3..426530d2e2aba 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon @@ -30,15 +30,15 @@ extern fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+12]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+12]]:1: error(RedeclExternMismatch): redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: extern_api.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: extern_api.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1: error(MissingDefinitionInImpl): no definition found for declaration in impl file // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -54,11 +54,11 @@ fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+7]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+7]]:1: error(RedeclExternMismatch): redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: extern_impl.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: extern_impl.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ extern fn A(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon index c5b1a736243ad..d9815d6b8663c 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon @@ -52,7 +52,7 @@ fn C(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file +// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error(MissingDefinitionInImpl): no definition found for declaration in impl file // CHECK:STDERR: fn C(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -66,7 +66,7 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error(MissingDefinitionInImpl): no definition found for declaration in impl file // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ fn D(); diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index ccb5b00473650..1b1d6fee16c87 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -47,20 +47,20 @@ library "[[@TEST_NAME]]"; import library "fns"; -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+8]]:1: error: redeclaration of `fn A` is redundant +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+8]]:1: error(RedeclRedundant): redeclaration of `fn A` is redundant // CHECK:STDERR: fn A() {}; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: fns.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: fns.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn A() {}; -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+8]]:1: error: redeclaration of `fn B` is redundant +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+8]]:1: error(RedeclRedundant): redeclaration of `fn B` is redundant // CHECK:STDERR: fn B(b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-14]]:1: in import -// CHECK:STDERR: fns.carbon:5:1: note: previously declared here +// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-14]]:1(InImport): in import +// CHECK:STDERR: fns.carbon:5:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn B(b: i32) -> i32 { return b; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -72,21 +72,21 @@ library "[[@TEST_NAME]]"; import library "extern"; -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: extern.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: extern.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fn A(); -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-15]]:1: in import -// CHECK:STDERR: extern.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-15]]:1(InImport): in import +// CHECK:STDERR: extern.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -98,11 +98,11 @@ library "[[@TEST_NAME]]"; import library "fns"; -// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+7]]:1: error: redeclarations of `fn D` must match use of `extern` +// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+7]]:1: error(RedeclExternMismatch): redeclarations of `fn D` must match use of `extern` // CHECK:STDERR: extern fn D(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: fns.carbon:7:1: note: previously declared here +// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: fns.carbon:7:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn D(); // CHECK:STDERR: ^~~~~~~ extern fn D(); diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index 4b796e7904f00..74d8abaae99de 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -48,7 +48,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:13: error: name `Def` not found +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:13: error(NameNotFound): name `Def` not found // CHECK:STDERR: var f: () = Def(); // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -60,7 +60,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: error: name `Def` not found +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: error(NameNotFound): name `Def` not found // CHECK:STDERR: var f: () = Test.Def(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -78,7 +78,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; -// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:13: error: name `ForwardWithDef` not found +// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:13: error(NameNotFound): name `ForwardWithDef` not found // CHECK:STDERR: var f: () = ForwardWithDef(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -90,7 +90,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: error: name `ForwardWithDef` not found +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: error(NameNotFound): name `ForwardWithDef` not found // CHECK:STDERR: var f: () = Test.ForwardWithDef(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -110,7 +110,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward"; -// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:13: error: name `Forward` not found +// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:13: error(NameNotFound): name `Forward` not found // CHECK:STDERR: var f: () = Forward(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -122,7 +122,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: error: name `Forward` not found +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:13: error(NameNotFound): name `Forward` not found // CHECK:STDERR: var f: () = Test.Forward(); // CHECK:STDERR: ^~~~~~~~~~~~ var f: () = Test.Forward(); diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon index 4241fbe3a7b14..ce0e549c39786 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern.carbon @@ -38,10 +38,10 @@ extern fn F() {} library "[[@TEST_NAME]]"; extern fn F(); -// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE+7]]:1: error(RedeclExternMismatch): redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -52,10 +52,10 @@ fn F() {} library "[[@TEST_NAME]]"; fn F(); -// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE+7]]:1: error(RedeclExternMismatch): redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -66,18 +66,18 @@ extern fn F() {} library "[[@TEST_NAME]]"; extern fn F(); -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `fn F` is redundant // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fn F(); -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error(RedeclExternMismatch): redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-12]]:1: note: previously declared here +// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-12]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -88,10 +88,10 @@ fn F() {} library "[[@TEST_NAME]]"; fn F() {} -// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant +// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+7]]:1: error(RedeclRedundant): redeclaration of `fn F` is redundant // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE-4]]:1: note: previously declared here +// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE-4]]:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -105,7 +105,7 @@ library "[[@TEST_NAME]]"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error: `extern` entities must have a declaration in the API file +// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error(ExternRequiresDeclInApiFile): `extern` entities must have a declaration in the API file // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ extern fn F() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon index 29dfc83a87083..4671391ac8910 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon @@ -54,11 +54,11 @@ extern fn F(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn F` must match use of `extern` +// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn F` must match use of `extern` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -80,7 +80,7 @@ import library "indirect_two_file_extern"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+4]]:1: error: `extern` entities must have a declaration in the API file +// CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+4]]:1: error(ExternRequiresDeclInApiFile): `extern` entities must have a declaration in the API file // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -102,7 +102,7 @@ impl library "[[@TEST_NAME]]"; import library "in_impl_extern"; -// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error: `extern` entities must have a declaration in the API file +// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+3]]:1: error(ExternRequiresDeclInApiFile): `extern` entities must have a declaration in the API file // CHECK:STDERR: extern fn F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ extern fn F() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon index e8c028b5cdd84..bef15a90da3b1 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon @@ -9,57 +9,57 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon fn F(); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error(RedeclParamCountDiffers): redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn F(x: ()) {} // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 0 +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note(RedeclParamCountPrevious): previously declared with parameter count of 0 // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn F(x: ()) {} fn G(x: ()); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 0 +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error(RedeclParamCountDiffers): redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn G() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 1 +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note(RedeclParamCountPrevious): previously declared with parameter count of 1 // CHECK:STDERR: fn G(x: ()); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: fn G() {} fn H(x: ()); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: error: package `Core` implicitly referenced here, but not found +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:9: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: fn H(x: bool) {} // CHECK:STDERR: ^~~~ // CHECK:STDERR: fn H(x: bool) {} fn I(); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `()` +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error(FunctionRedeclReturnTypeDiffers): function redeclaration differs because return type is `()` // CHECK:STDERR: fn I() -> () { return (); } // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with no return type +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note(FunctionRedeclReturnTypePreviousNoReturn): previously declared with no return type // CHECK:STDERR: fn I(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn I() -> () { return (); } fn J() -> (); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because no return type is provided +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error(FunctionRedeclReturnTypeDiffersNoReturn): function redeclaration differs because no return type is provided // CHECK:STDERR: fn J() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with return type `()` +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note(FunctionRedeclReturnTypePrevious): previously declared with return type `()` // CHECK:STDERR: fn J() -> (); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: fn J() {} fn K() -> (); -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: error: function redeclaration differs because return type is `{}` +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+6]]:1: error(FunctionRedeclReturnTypeDiffers): function redeclaration differs because return type is `{}` // CHECK:STDERR: fn K() -> {} { return {}; } // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with return type `()` +// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note(FunctionRedeclReturnTypePrevious): previously declared with return type `()` // CHECK:STDERR: fn K() -> (); // CHECK:STDERR: ^~~~~~~~~~~~~ fn K() -> {} { return {}; } diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon index 82cfa1e6e626b..052ad95e30a53 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon fn F() {} -// CHECK:STDERR: fail_redef.carbon:[[@LINE+6]]:1: error: redefinition of `fn F` +// CHECK:STDERR: fail_redef.carbon:[[@LINE+6]]:1: error(RedeclRedef): redefinition of `fn F` // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redef.carbon:[[@LINE-4]]:1: note: previously defined here +// CHECK:STDERR: fail_redef.carbon:[[@LINE-4]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ fn F() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon index 26fc4af81ac00..991f585a341ea 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon @@ -30,11 +30,11 @@ extern fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: extern_api.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: extern_api.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: extern fn A(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -50,11 +50,11 @@ fn A(); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+8]]:1: error(RedeclExternMismatch): redeclarations of `fn A` must match use of `extern` // CHECK:STDERR: extern fn A() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: extern_impl.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: extern_impl.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -70,11 +70,11 @@ fn A() {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+8]]:1: error: redeclaration of `fn A` is redundant +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+8]]:1: error(RedeclRedundant): redeclaration of `fn A` is redundant // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: redecl_after_def.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: redecl_after_def.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -90,11 +90,11 @@ fn A() {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+8]]:1: error: redefinition of `fn A` +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+8]]:1: error(RedeclRedef): redefinition of `fn A` // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: redef_after_def.carbon:4:1: note: previously defined here +// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: redef_after_def.carbon:4:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn A() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -111,11 +111,11 @@ alias B = A; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn B() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here +// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: def_alias.carbon:5:7: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: alias B = A; // CHECK:STDERR: ^ fn B() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon index 5a95897fc0025..7d8fc316cb35a 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon @@ -37,10 +37,10 @@ library "[[@TEST_NAME]]"; class C {} fn Foo(a: C); -// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here +// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:11: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:11: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -80,10 +80,10 @@ class C {} alias D = C; fn Foo(a: C); -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:8: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:8: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: fn Foo(b: D) {} // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -97,10 +97,10 @@ class C {} alias D = C; fn Foo(a: C); -// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here +// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:11: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:11: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: fn Foo(a: C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -114,10 +114,10 @@ class C {} alias D = C; fn Foo[a:! C](); -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:12: error: redeclaration syntax differs here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:12: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: fn Foo[a:! D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:12: note: comparing with previous declaration here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:12: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: fn Foo[a:! C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -156,14 +156,14 @@ library "[[@TEST_NAME]]"; class C {} fn Foo(a: const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:11: warning: `const` applied repeatedly to the same type has no additional effect +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:11: warning(RepeatedConst): `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: fn Foo(a: const (const C)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:17: error: redeclaration syntax differs here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:17: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: fn Foo(a: const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: note: comparing with previous declaration here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: fn Foo(a: const C); // CHECK:STDERR: ^ fn Foo(a: const (const C)) {} diff --git a/toolchain/check/testdata/function/generic/deduce.carbon b/toolchain/check/testdata/function/generic/deduce.carbon index 3bf496628de90..77d736e9d7ab1 100644 --- a/toolchain/check/testdata/function/generic/deduce.carbon +++ b/toolchain/check/testdata/function/generic/deduce.carbon @@ -33,10 +33,10 @@ fn CallExplicitGenericParamConst(T:! type) { } fn CallExplicitGenericParamNonConst(T: type) { - // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE+7]]:3: error: argument for generic parameter is not a compile-time constant + // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE+7]]:3: error(CompTimeArgumentNotConstant): argument for generic parameter is not a compile-time constant // CHECK:STDERR: ExplicitGenericParam(T); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE-10]]:25: note: initializing generic parameter `T` declared here + // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE-10]]:25: note(InitializingGenericParam): initializing generic parameter `T` declared here // CHECK:STDERR: fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -84,10 +84,10 @@ library "[[@TEST_NAME]]"; fn StructParam[T:! type](x: {.a: T, .b: i32}) {} fn CallStructParam() { - // CHECK:STDERR: fail_todo_deduce_nested_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` + // CHECK:STDERR: fail_todo_deduce_nested_struct.carbon:[[@LINE+7]]:3: error(DeductionIncomplete): cannot deduce value for generic parameter `T` // CHECK:STDERR: StructParam({.a = 1, .b = 2}); // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_deduce_nested_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here + // CHECK:STDERR: fail_todo_deduce_nested_struct.carbon:[[@LINE-6]]:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: fn StructParam[T:! type](x: {.a: T, .b: i32}) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -103,10 +103,10 @@ library "[[@TEST_NAME]]"; fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U; fn CallImplicitNotDeducible() { - // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `U` + // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: error(DeductionIncomplete): cannot deduce value for generic parameter `U` // CHECK:STDERR: ImplicitNotDeducible(42); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here + // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -120,10 +120,10 @@ library "[[@TEST_NAME]]"; fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T; fn CallImplicitNotDeducible() { - // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+6]]:3: error: inconsistent deductions for value of generic parameter `T` + // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+6]]:3: error(DeductionInconsistent): inconsistent deductions for value of generic parameter `T` // CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here + // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ImplicitNotDeducible(42, {.x = 12}); diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index 0f73d209d003c..ced987e6efb36 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon -// CHECK:STDERR: fail_todo_param_in_type.carbon:[[@LINE+3]]:24: error: semantics TODO: `symbolic array bound` +// CHECK:STDERR: fail_todo_param_in_type.carbon:[[@LINE+3]]:24: error(SemanticsTodo): semantics TODO: `symbolic array bound` // CHECK:STDERR: fn F(N:! i32, a: [i32; N]*); // CHECK:STDERR: ^ fn F(N:! i32, a: [i32; N]*); diff --git a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon index c16b77706f9e7..5f4a5f7fb6af6 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon +++ b/toolchain/check/testdata/function/generic/no_prelude/fail_type_param_mismatch.carbon @@ -10,7 +10,7 @@ fn F(T:! type, U:! type) { var p: T*; - // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+3]]:3: error: package `Core` implicitly referenced here, but not found + // CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+3]]:3: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: let n: U = *p; // CHECK:STDERR: ^~~~~~~~~~~~~~ let n: U = *p; diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index 59b1cdcd4e987..5caac6974df74 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -24,18 +24,18 @@ library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `U*` +// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:1: error(FunctionRedeclReturnTypeDiffers): function redeclaration differs because return type is `U*` // CHECK:STDERR: fn F(T:! type, U:! type) -> U* { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-5]]:1: note: previously declared with return type `T*` +// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-5]]:1: note(FunctionRedeclReturnTypePrevious): previously declared with return type `T*` // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn F(T:! type, U:! type) -> U* { - // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 2 arguments + // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 1 argument passed to function expecting 2 arguments // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-13]]:1: note: calling function declared here + // CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-13]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -48,18 +48,18 @@ library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: fn F(U:! type, T:! type) -> T* { // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn F(U:! type, T:! type) -> T* { - // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 2 arguments + // CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: error(CallArgCountMismatch): 1 argument passed to function expecting 2 arguments // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_reorder.carbon:[[@LINE-13]]:1: note: calling function declared here + // CHECK:STDERR: fail_reorder.carbon:[[@LINE-13]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -72,18 +72,18 @@ library "[[@TEST_NAME]]"; fn F(T:! type, U:! type) -> T*; -// CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:6: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: fn F(U:! type, T:! type) -> U* { // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_rename.carbon:[[@LINE-5]]:6: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_rename.carbon:[[@LINE-5]]:6: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: fn F(U:! type, T:! type) -> U* { - // CHECK:STDERR: fail_rename.carbon:[[@LINE+6]]:10: error: 1 argument passed to function expecting 2 arguments + // CHECK:STDERR: fail_rename.carbon:[[@LINE+6]]:10: error(CallArgCountMismatch): 1 argument passed to function expecting 2 arguments // CHECK:STDERR: return F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_rename.carbon:[[@LINE-13]]:1: note: calling function declared here + // CHECK:STDERR: fail_rename.carbon:[[@LINE-13]]:1: note(InCallToEntity): calling function declared here // CHECK:STDERR: fn F(T:! type, U:! type) -> T*; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return F(T); diff --git a/toolchain/check/testdata/function/generic/resolve_used.carbon b/toolchain/check/testdata/function/generic/resolve_used.carbon index 2643a07fc8eb8..b4fd7d3a2e9f8 100644 --- a/toolchain/check/testdata/function/generic/resolve_used.carbon +++ b/toolchain/check/testdata/function/generic/resolve_used.carbon @@ -17,7 +17,7 @@ fn ErrorIfNIsZero(N:! i32) { // ensuring we produce an error when doing so. Notionally this error is // produced as a result of instantiating the `Core.Int` template, although // that's not how we currently model `Core.Int`. - // CHECK:STDERR: fail_call_monomorphization_error.carbon:[[@LINE+3]]:10: error: integer type width of 0 is not positive + // CHECK:STDERR: fail_call_monomorphization_error.carbon:[[@LINE+3]]:10: error(IntWidthNotPositive): integer type width of 0 is not positive // CHECK:STDERR: var v: Core.Int(N); // CHECK:STDERR: ^~~~~~~~~ var v: Core.Int(N); diff --git a/toolchain/check/testdata/function/generic/undefined.carbon b/toolchain/check/testdata/function/generic/undefined.carbon index 90131aef25e41..6e1ba5ccb1df4 100644 --- a/toolchain/check/testdata/function/generic/undefined.carbon +++ b/toolchain/check/testdata/function/generic/undefined.carbon @@ -41,10 +41,10 @@ library "[[@TEST_NAME]]"; fn Undefined[T:! type](x: T) -> T; fn CallUndefined() -> i32 { - // CHECK:STDERR: fail_call_undefined.carbon:[[@LINE+6]]:10: error: use of undefined generic function + // CHECK:STDERR: fail_call_undefined.carbon:[[@LINE+6]]:10: error(MissingGenericFunctionDefinition): use of undefined generic function // CHECK:STDERR: return Undefined(0); // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_call_undefined.carbon:[[@LINE-6]]:1: note: generic function declared here + // CHECK:STDERR: fail_call_undefined.carbon:[[@LINE-6]]:1: note(MissingGenericFunctionDefinitionHere): generic function declared here // CHECK:STDERR: fn Undefined[T:! type](x: T) -> T; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ return Undefined(0); diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index 52a4cdbd9e2d5..ce41c17660fd9 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -13,7 +13,7 @@ fn If1(b: bool) -> i32 { return 1; } else { } -// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: error: missing `return` at end of function with declared return type +// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: error(MissingReturnStatement): missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -24,7 +24,7 @@ fn If2(b: bool) -> i32 { } else { return 2; } -// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: error: missing `return` at end of function with declared return type +// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+4]]:1: error(MissingReturnStatement): missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -34,7 +34,7 @@ fn If3(b: bool) -> i32 { if (b) { return 1; } -// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type +// CHECK:STDERR: fail_reachable_fallthrough.carbon:[[@LINE+3]]:1: error(MissingReturnStatement): missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index f34723ea5b695..20cafe98d714e 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -13,7 +13,7 @@ fn VarScope(b: bool) -> i32 { var n: i32 = 2; return n; } - // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: error: name `n` not found + // CHECK:STDERR: fail_scope.carbon:[[@LINE+3]]:10: error(NameNotFound): name `n` not found // CHECK:STDERR: return n; // CHECK:STDERR: ^ return n; diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 125e15b2291b3..9153ee023c0e5 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -8,30 +8,30 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/if_expr/fail_not_in_function.carbon -// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+12]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+12]]:14: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+8]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+8]]:14: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+4]]:22: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+4]]:22: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: let x: i32 = if true then 1 else 0; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: let x: i32 = if true then 1 else 0; class C { - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+11]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` + // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+11]]:10: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var n: if true then i32 else f64; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+7]]:10: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` + // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+7]]:10: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var n: if true then i32 else f64; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+3]]:18: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` + // CHECK:STDERR: fail_not_in_function.carbon:[[@LINE+3]]:18: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var n: if true then i32 else f64; // CHECK:STDERR: ^~~~~~~~ var n: if true then i32 else f64; diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index 144a4d387cc9e..5e502bbd3027a 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -16,7 +16,7 @@ fn ConditionIsNonConstant(b: bool) { // We choose to not accept this even if both arms evaluate to the same // constant value, because it notionally involves evaluating a non-constant // condition. - // CHECK:STDERR: fail_non_constant_condition.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression + // CHECK:STDERR: fail_non_constant_condition.carbon:[[@LINE+4]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var v: if b then i32 else i32 = 1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -28,12 +28,12 @@ fn ConditionIsNonConstant(b: bool) { package NonConstantResult; fn ChosenBranchIsNonConstant(t: type) { - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var v: if true then t else i32 = 1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var v: if true then t else i32 = 1; - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+3]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var w: if false then i32 else t = 1; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ var w: if false then i32 else t = 1; diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index f624e7a23e7f0..fc7ed4bae542f 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -13,7 +13,7 @@ interface Simple { } impl i32 as Simple { - // CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+3]]:14: error: name `Undeclared` not found + // CHECK:STDERR: fail_call_invalid.carbon:[[@LINE+3]]:14: error(NameNotFound): name `Undeclared` not found // CHECK:STDERR: fn G[self: Undeclared](); // CHECK:STDERR: ^~~~~~~~~~ fn G[self: Undeclared](); diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index a02708bf9ffe3..0bba438f72c15 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -13,7 +13,7 @@ interface GenericInterface(T:! type) { } class C { - // CHECK:STDERR: fail_extend_impl_forall.carbon:[[@LINE+3]]:3: error: cannot `extend` a parameterized `impl` + // CHECK:STDERR: fail_extend_impl_forall.carbon:[[@LINE+3]]:3: error(ExtendImplForall): cannot `extend` a parameterized `impl` // CHECK:STDERR: extend impl forall [T:! type] as GenericInterface(T) { // CHECK:STDERR: ^~~~~~ extend impl forall [T:! type] as GenericInterface(T) { diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index 0db885bf54f66..453353292f8fe 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -10,7 +10,7 @@ interface I {} -// CHECK:STDERR: fail_extend_impl_scope.carbon:[[@LINE+3]]:1: error: `extend impl` can only be used in a class +// CHECK:STDERR: fail_extend_impl_scope.carbon:[[@LINE+3]]:1: error(ExtendImplOutsideClass): `extend impl` can only be used in a class // CHECK:STDERR: extend impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ extend impl i32 as I {} diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index e7f5397d53f5d..3a7774a92b7ee 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -11,7 +11,7 @@ interface I {} class C { - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:3: error: cannot `extend` an `impl` with an explicit self type + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:3: error(ExtendImplSelfAs): cannot `extend` an `impl` with an explicit self type // CHECK:STDERR: extend impl i32 as I {} // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -19,10 +19,10 @@ class C { } class D { - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+7]]:3: error: cannot `extend` an `impl` with an explicit self type + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+7]]:3: error(ExtendImplSelfAs): cannot `extend` an `impl` with an explicit self type // CHECK:STDERR: extend impl D as I; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:15: note: remove the explicit `Self` type here + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+4]]:15: note(ExtendImplSelfAsDefault): remove the explicit `Self` type here // CHECK:STDERR: extend impl D as I; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -30,10 +30,10 @@ class D { } class E { - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+6]]:3: error: cannot `extend` an `impl` with an explicit self type + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+6]]:3: error(ExtendImplSelfAs): cannot `extend` an `impl` with an explicit self type // CHECK:STDERR: extend impl Self as I {} // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+3]]:15: note: remove the explicit `Self` type here + // CHECK:STDERR: fail_extend_impl_type_as.carbon:[[@LINE+3]]:15: note(ExtendImplSelfAsDefault): remove the explicit `Self` type here // CHECK:STDERR: extend impl Self as I {} // CHECK:STDERR: ^~~~ extend impl Self as I {} diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index 06dab0c72dd62..c787d2dea43de 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_extend_non_interface.carbon class C { - // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+3]]:3: error: semantics TODO: `extending non-interface constraint` + // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+3]]:3: error(SemanticsTodo): semantics TODO: `extending non-interface constraint` // CHECK:STDERR: extend impl as i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ extend impl as i32; diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index d201f5b4284bc..c52e540678494 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -10,10 +10,10 @@ interface I { class C { - // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+6]]:5: error: `extend impl` requires a definition for interface `I` + // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE+6]]:5: error(ExtendUndefinedInterface): `extend impl` requires a definition for interface `I` // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: note: interface is currently being defined + // CHECK:STDERR: fail_extend_partially_defined_interface.carbon:[[@LINE-5]]:1: note(InterfaceUndefinedWithinDefinition): interface is currently being defined // CHECK:STDERR: interface I { // CHECK:STDERR: ^~~~~~~~~~~~~ extend impl as I; diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index 4ecf0e45246b3..f797ed43d104f 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -11,10 +11,10 @@ interface I; class C { - // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+6]]:3: error: `extend impl` requires a definition for interface `I` + // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE+6]]:3: error(ExtendUndefinedInterface): `extend impl` requires a definition for interface `I` // CHECK:STDERR: extend impl as I; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-6]]:1: note: interface was forward declared here + // CHECK:STDERR: fail_extend_undefined_interface.carbon:[[@LINE-6]]:1: note(InterfaceForwardDeclaredHere): interface was forward declared here // CHECK:STDERR: interface I; // CHECK:STDERR: ^~~~~~~~~~~~ extend impl as I; diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index fe50528970924..68022bcecc197 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -12,7 +12,7 @@ interface Simple { fn F(); } -// CHECK:STDERR: fail_impl_as_scope.carbon:[[@LINE+3]]:6: error: `impl as` can only be used in a class +// CHECK:STDERR: fail_impl_as_scope.carbon:[[@LINE+3]]:6: error(ImplAsOutsideClass): `impl as` can only be used in a class // CHECK:STDERR: impl as Simple { // CHECK:STDERR: ^~ impl as Simple { diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon index c781834abe700..60bc7391c2397 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon @@ -10,7 +10,7 @@ interface I { let T:! type; } -// CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+3]]:1: error: semantics TODO: `impl of interface with associated constant` +// CHECK:STDERR: fail_impl_bad_assoc_const.carbon:[[@LINE+3]]:1: error(SemanticsTodo): semantics TODO: `impl of interface with associated constant` // CHECK:STDERR: impl bool as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~ impl bool as I {} diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index d0621b57d355f..672b4f7d15030 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -11,10 +11,10 @@ interface I { fn F(); } class NoF { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: error: missing implementation of F in impl of interface I + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:3: error(ImplMissingFunction): missing implementation of F in impl of interface I // CHECK:STDERR: impl as I {} // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: note: associated function F declared here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-6]]:15: note(ImplAssociatedFunctionHere): associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -23,10 +23,10 @@ class NoF { class FNotFunction { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: associated function F implemented by non-function + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error(ImplFunctionWithNonFunction): associated function F implemented by non-function // CHECK:STDERR: class F; // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: note: associated function F declared here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-18]]:15: note(ImplAssociatedFunctionHere): associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -39,10 +39,10 @@ fn PossiblyF(); // TODO: Should this be permitted? class FAlias { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: error: associated function F implemented by non-function + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:11: error(ImplFunctionWithNonFunction): associated function F implemented by non-function // CHECK:STDERR: alias F = PossiblyF; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: note: associated function F declared here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-34]]:15: note(ImplAssociatedFunctionHere): associated function F declared here // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -52,10 +52,10 @@ class FAlias { class FExtraParam { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 1 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error(RedeclParamCountDiffers): redeclaration differs because of parameter count of 1 // CHECK:STDERR: fn F(b: bool); // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: note: previously declared with parameter count of 0 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-47]]:15: note(RedeclParamCountPrevious): previously declared with parameter count of 0 // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -65,10 +65,10 @@ class FExtraParam { class FExtraImplicitParam { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of implicit parameter list + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error(RedeclParamListDiffers): redeclaration differs because of implicit parameter list // CHECK:STDERR: fn F[self: Self](); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: note: previously declared without implicit parameter list + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-60]]:15: note(RedeclParamListPrevious): previously declared without implicit parameter list // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -79,10 +79,10 @@ class FExtraImplicitParam { // TODO: Should this be permitted? class FExtraReturnType { impl as I { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `bool` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error(FunctionRedeclReturnTypeDiffers): function redeclaration differs because return type is `bool` // CHECK:STDERR: fn F() -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: note: previously declared with no return type + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-74]]:15: note(FunctionRedeclReturnTypePreviousNoReturn): previously declared with no return type // CHECK:STDERR: interface I { fn F(); } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -94,10 +94,10 @@ interface J { fn F[self: bool](b: bool) -> bool; } class FMissingParam { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of parameter count of 0 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error(RedeclParamCountDiffers): redeclaration differs because of parameter count of 0 // CHECK:STDERR: fn F[self: bool]() -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: note: previously declared with parameter count of 1 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-7]]:15: note(RedeclParamCountPrevious): previously declared with parameter count of 1 // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -107,10 +107,10 @@ class FMissingParam { class FMissingImplicitParam { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: redeclaration differs because of missing implicit parameter list + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error(RedeclParamListDiffers): redeclaration differs because of missing implicit parameter list // CHECK:STDERR: fn F(b: bool) -> bool; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: note: previously declared with implicit parameter list + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-20]]:15: note(RedeclParamListPrevious): previously declared with implicit parameter list // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -120,10 +120,10 @@ class FMissingImplicitParam { class FMissingReturnType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because no return type is provided + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error(FunctionRedeclReturnTypeDiffersNoReturn): function redeclaration differs because no return type is provided // CHECK:STDERR: fn F[self: bool](b: bool); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: note: previously declared with return type `bool` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-33]]:15: note(FunctionRedeclReturnTypePrevious): previously declared with return type `bool` // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -133,10 +133,10 @@ class FMissingReturnType { class FDifferentParamType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: fn F[self: bool](b: Self) -> bool; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: note: previous declaration's corresponding parameter here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-46]]:32: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -146,10 +146,10 @@ class FDifferentParamType { class FDifferentImplicitParamType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at implicit parameter 1 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error(RedeclParamDiffers): redeclaration differs at implicit parameter 1 // CHECK:STDERR: fn F[self: Self](b: bool) -> bool; // CHECK:STDERR: ^~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: note: previous declaration's corresponding implicit parameter here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-59]]:20: note(RedeclParamPrevious): previous declaration's corresponding implicit parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -159,10 +159,10 @@ class FDifferentImplicitParamType { class FDifferentReturnType { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error: function redeclaration differs because return type is `FDifferentReturnType` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:5: error(FunctionRedeclReturnTypeDiffers): function redeclaration differs because return type is `FDifferentReturnType` // CHECK:STDERR: fn F[self: bool](b: bool) -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: note: previously declared with return type `bool` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-72]]:15: note(FunctionRedeclReturnTypePrevious): previously declared with return type `bool` // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -173,10 +173,10 @@ class FDifferentReturnType { // TODO: This should probably be permitted. class FDifferentParamName { impl as J { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error: redeclaration differs at parameter 1 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:22: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: fn F[self: bool](not_b: bool) -> bool; // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: note: previous declaration's corresponding parameter here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-86]]:32: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: interface J { fn F[self: bool](b: bool) -> bool; } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -190,10 +190,10 @@ interface SelfNested { class SelfNestedBadParam { impl as SelfNested { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error: redeclaration differs at parameter 1 + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+7]]:10: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: fn F(x: (SelfNestedBadParam*, {.x: i32, .y: i32})) -> [SelfNestedBadParam; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: note: previous declaration's corresponding parameter here + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-8]]:8: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -203,10 +203,10 @@ class SelfNestedBadParam { class SelfNestedBadReturnType { impl as SelfNested { - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: error: function redeclaration differs because return type is `[SelfNestedBadParam; 4]` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE+6]]:5: error(FunctionRedeclReturnTypeDiffers): function redeclaration differs because return type is `[SelfNestedBadParam; 4]` // CHECK:STDERR: fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: note: previously declared with return type `[SelfNestedBadReturnType; 4]` + // CHECK:STDERR: fail_impl_bad_assoc_fn.carbon:[[@LINE-21]]:3: note(FunctionRedeclReturnTypePrevious): previously declared with return type `[SelfNestedBadReturnType; 4]` // CHECK:STDERR: fn F(x: (Self*, {.x: Self, .y: i32})) -> [Self; 4]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn F(x: (SelfNestedBadReturnType*, {.x: SelfNestedBadReturnType, .y: i32})) -> [SelfNestedBadParam; 4]; diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index ba257969beac1..db4a4cfba1d0d 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -8,14 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_impl_bad_interface.carbon -// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+10]]:1: error: semantics TODO: `impl as non-interface` +// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+10]]:1: error(SemanticsTodo): semantics TODO: `impl as non-interface` // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+6]]:13: error: cannot implicitly convert from `bool` to `type` +// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+6]]:13: error(ImplicitAsConversionFailure): cannot implicitly convert from `bool` to `type` // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+3]]:13: note: type `bool` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_impl_bad_interface.carbon:[[@LINE+3]]:13: note(MissingImplInMemberAccessNote): type `bool` does not implement interface `ImplicitAs` // CHECK:STDERR: impl i32 as false {} // CHECK:STDERR: ^~~~~ impl i32 as false {} diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 3cb722ee76430..8a18d05c03184 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -12,10 +12,10 @@ interface I {} impl i32 as I {} -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error: redefinition of `impl i32 as I` +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+6]]:1: error(ImplRedefinition): redefinition of `impl i32 as I` // CHECK:STDERR: impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: note: previous definition was here +// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-5]]:1: note(ImplPreviousDefinition): previous definition was here // CHECK:STDERR: impl i32 as I {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ impl i32 as I {} diff --git a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon index 893149314d712..39f06510d40d1 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -10,14 +10,14 @@ interface I { let T:! type; } -// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+10]]:1: error: semantics TODO: `impl of interface with associated constant` +// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+10]]:1: error(SemanticsTodo): semantics TODO: `impl of interface with associated constant` // CHECK:STDERR: impl bool as I where .T = bool {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+6]]:27: error: cannot implicitly convert from `type` to `` +// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+6]]:27: error(ImplicitAsConversionFailure): cannot implicitly convert from `type` to `` // CHECK:STDERR: impl bool as I where .T = bool {} // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+3]]:27: note: type `type` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_todo_impl_assoc_const.carbon:[[@LINE+3]]:27: note(MissingImplInMemberAccessNote): type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: impl bool as I where .T = bool {} // CHECK:STDERR: ^~~~ impl bool as I where .T = bool {} diff --git a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon index 4b819f0d87236..a41a3835fa740 100644 --- a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon @@ -17,12 +17,12 @@ class C { } fn F(c: C) { - // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+4]]:3: error: cannot access member of interface `I` in type `C` that does not implement that interface + // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+4]]:3: error(MissingImplInMemberAccess): cannot access member of interface `I` in type `C` that does not implement that interface // CHECK:STDERR: C.F(); // CHECK:STDERR: ^~~ // CHECK:STDERR: C.F(); - // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+3]]:3: error: cannot access member of interface `I` in type `C` that does not implement that interface + // CHECK:STDERR: fail_alias_impl_not_found.carbon:[[@LINE+3]]:3: error(MissingImplInMemberAccess): cannot access member of interface `I` in type `C` that does not implement that interface // CHECK:STDERR: c.F(); // CHECK:STDERR: ^~~ c.F(); diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 9b90a79baa087..fd128c9475631 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -18,7 +18,7 @@ class C { fn F() -> i32 { // TODO: This should produce a more useful error message. - // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `I` in type `C` that does not implement that interface + // CHECK:STDERR: fail_todo_undefined_impl.carbon:[[@LINE+3]]:10: error(MissingImplInMemberAccess): cannot access member of interface `I` in type `C` that does not implement that interface // CHECK:STDERR: return C.F(); // CHECK:STDERR: ^~~ return C.F(); diff --git a/toolchain/check/testdata/impl/lookup/generic.carbon b/toolchain/check/testdata/impl/lookup/generic.carbon index 30c412cbcf663..205fc7ca3ed69 100644 --- a/toolchain/check/testdata/impl/lookup/generic.carbon +++ b/toolchain/check/testdata/impl/lookup/generic.carbon @@ -90,7 +90,7 @@ impl forall [T:! type, U:! type] T as HasF { fn G(x: {}) { // TODO: It'd be nice to include a note here saying that deduction failed because // we couldn't deduce a value for 'U'. - // CHECK:STDERR: fail_incomplete_deduction.carbon:[[@LINE+4]]:3: error: cannot access member of interface `HasF` in type `{}` that does not implement that interface + // CHECK:STDERR: fail_incomplete_deduction.carbon:[[@LINE+4]]:3: error(MissingImplInMemberAccess): cannot access member of interface `HasF` in type `{}` that does not implement that interface // CHECK:STDERR: x.(HasF.F)(); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: @@ -115,7 +115,7 @@ class B {} fn G(x: A) { // TODO: It'd be nice to include a note here saying that deduction failed because // we deduced two different values for `T`. - // CHECK:STDERR: fail_inconsistent_deduction.carbon:[[@LINE+3]]:3: error: cannot access member of interface `HasF` in type `A` that does not implement that interface + // CHECK:STDERR: fail_inconsistent_deduction.carbon:[[@LINE+3]]:3: error(MissingImplInMemberAccess): cannot access member of interface `HasF` in type `A` that does not implement that interface // CHECK:STDERR: x.(HasF(B).F)(); // CHECK:STDERR: ^~~~~~~~~~~~~ x.(HasF(B).F)(); diff --git a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon b/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon index f5f4d3a6660a9..428df64d7357d 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon @@ -16,10 +16,10 @@ alias AC = C; impl AC as AI {} -// CHECK:STDERR: fail_alias.carbon:[[@LINE+6]]:1: error: redefinition of `impl AC as AI` +// CHECK:STDERR: fail_alias.carbon:[[@LINE+6]]:1: error(ImplRedefinition): redefinition of `impl AC as AI` // CHECK:STDERR: impl AC as AI {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-5]]:1: note: previous definition was here +// CHECK:STDERR: fail_alias.carbon:[[@LINE-5]]:1: note(ImplPreviousDefinition): previous definition was here // CHECK:STDERR: impl AC as AI {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ impl AC as AI {} diff --git a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon index 5aa695b0d77c6..b42f324e7d64b 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon @@ -10,7 +10,7 @@ interface I {} -// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+3]]:6: error: package `Core` implicitly referenced here, but not found +// CHECK:STDERR: fail_impl_bad_type.carbon:[[@LINE+3]]:6: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: impl true as I {} // CHECK:STDERR: ^~~~ impl true as I {} diff --git a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon index d9d920b54f07e..c184bce28afbc 100644 --- a/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon +++ b/toolchain/check/testdata/impl/no_prelude/generic_redeclaration.carbon @@ -39,10 +39,10 @@ interface I {} interface J {} impl forall [T:! I] T as J {} -// CHECK:STDERR: fail_same_self_and_interface_redefined.carbon:[[@LINE+6]]:1: error: redefinition of `impl T as J` +// CHECK:STDERR: fail_same_self_and_interface_redefined.carbon:[[@LINE+6]]:1: error(ImplRedefinition): redefinition of `impl T as J` // CHECK:STDERR: impl forall [T:! I] T as J {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_same_self_and_interface_redefined.carbon:[[@LINE-4]]:1: note: previous definition was here +// CHECK:STDERR: fail_same_self_and_interface_redefined.carbon:[[@LINE-4]]:1: note(ImplPreviousDefinition): previous definition was here // CHECK:STDERR: impl forall [T:! I] T as J {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ impl forall [T:! I] T as J {} diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon index 0c284f90811f9..b45f4f1141e29 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/no_prelude/import_generic.carbon @@ -28,11 +28,11 @@ impl forall [T:! type] C as I(T) {} impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE+7]]:1: error: redefinition of `impl C as I` +// CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE+7]]:1: error(ImplRedefinition): redefinition of `impl C as I` // CHECK:STDERR: impl forall [T:! type] C as I(T*) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: import_generic.carbon:8:1: note: previous definition was here +// CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: import_generic.carbon:8:1: note(ImplPreviousDefinition): previous definition was here // CHECK:STDERR: impl forall [T:! type] C as I(T*) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ impl forall [T:! type] C as I(T*) {} diff --git a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon index 3314d5190167f..71f4d759f02c6 100644 --- a/toolchain/check/testdata/impl/no_prelude/interface_args.carbon +++ b/toolchain/check/testdata/impl/no_prelude/interface_args.carbon @@ -36,7 +36,7 @@ fn G(a: A) { a.(Action(B).Op)(); } impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: error: cannot access member of interface `Action` in type `A` that does not implement that interface +// CHECK:STDERR: fail_action.impl.carbon:[[@LINE+4]]:14: error(MissingImplInMemberAccess): cannot access member of interface `Action` in type `A` that does not implement that interface // CHECK:STDERR: fn G(a: A) { a.(Action(C).Op)(); } // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -72,7 +72,7 @@ impl library "[[@TEST_NAME]]"; class C {} fn MakeC(a: A) -> C { - // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Factory` in type `A` that does not implement that interface + // CHECK:STDERR: fail_factory.impl.carbon:[[@LINE+3]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Factory` in type `A` that does not implement that interface // CHECK:STDERR: return a.(Factory(C).Make)(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ return a.(Factory(C).Make)(); diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon index dcc3968400eba..25046ddb2c294 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon @@ -58,7 +58,7 @@ impl () as C; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file +// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error(MissingDefinitionInImpl): no definition found for declaration in impl file // CHECK:STDERR: impl () as C; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -74,7 +74,7 @@ impl library "[[@TEST_NAME]]"; interface D {}; -// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error: no definition found for declaration in impl file +// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+3]]:1: error(MissingDefinitionInImpl): no definition found for declaration in impl file // CHECK:STDERR: impl () as D; // CHECK:STDERR: ^~~~~~~~~~~~~ impl () as D; diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index c92bc3bd95001..a93b99f4306b7 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -10,13 +10,13 @@ var a: [i32; 1] = (12,); -// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+4]]:16: error: array index `1` is past the end of type `[i32; 1]` +// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+4]]:16: error(ArrayIndexOutOfBounds): array index `1` is past the end of type `[i32; 1]` // CHECK:STDERR: var b: i32 = a[1]; // CHECK:STDERR: ^ // CHECK:STDERR: var b: i32 = a[1]; -// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+3]]:16: error: array index `2147483647` is past the end of type `[i32; 1]` +// CHECK:STDERR: fail_array_large_index.carbon:[[@LINE+3]]:16: error(ArrayIndexOutOfBounds): array index `2147483647` is past the end of type `[i32; 1]` // CHECK:STDERR: var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDERR: ^~~~~~~~~~~ var c: i32 = a[0x7FFF_FFFF]; diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index 8e1b10f2ad95e..423d0d203de52 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_array_non_int_indexing.carbon var a: [i32; 1] = (12,); -// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+6]]:16: error: cannot implicitly convert from `f64` to `i32` +// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+6]]:16: error(ImplicitAsConversionFailure): cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: note: type `f64` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_array_non_int_indexing.carbon:[[@LINE+3]]:16: note(MissingImplInMemberAccessNote): type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: i32 = a[2.6]; // CHECK:STDERR: ^~~ var b: i32 = a[2.6]; diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index e7edb21af7145..db129d2d31b55 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon var a: [i32; 1] = (12,); -// CHECK:STDERR: fail_array_out_of_bound_access.carbon:[[@LINE+3]]:16: error: array index `1` is past the end of type `[i32; 1]` +// CHECK:STDERR: fail_array_out_of_bound_access.carbon:[[@LINE+3]]:16: error(ArrayIndexOutOfBounds): array index `1` is past the end of type `[i32; 1]` // CHECK:STDERR: var b: i32 = a[1]; // CHECK:STDERR: ^ var b: i32 = a[1]; diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 525a6653aa2bf..9f58ac5ea37de 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -12,12 +12,12 @@ fn F() -> [i32; 3]; fn G(b: [i32; 3]) { // Indexing an array value gives a value. - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: var pb: i32* = &b[0]; // CHECK:STDERR: ^ // CHECK:STDERR: var pb: i32* = &b[0]; - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: error: expression is not assignable + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: b[0] = 4; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -25,12 +25,12 @@ fn G(b: [i32; 3]) { // Indexing an ephemeral reference (materialized from an initializing // expression) gives a value. - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+4]]:18: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: var pf: i32* = &F()[0]; // CHECK:STDERR: ^ // CHECK:STDERR: var pf: i32* = &F()[0]; - // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+3]]:3: error: expression is not assignable + // CHECK:STDERR: fail_expr_category.carbon:[[@LINE+3]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: F()[0] = 4; // CHECK:STDERR: ^~~~~~ F()[0] = 4; diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 54d2ac6bff48e..a028f12563871 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -9,26 +9,26 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_invalid_base.carbon namespace N; -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error: expression cannot be used as a value +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: var a: i32 = N[0]; // CHECK:STDERR: ^ // CHECK:STDERR: var a: i32 = N[0]; fn F(); -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error: expression cannot be used as a value +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: var b: i32 = F[1]; // CHECK:STDERR: ^ // CHECK:STDERR: var b: i32 = F[1]; -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error: type `{.a: i32, .b: i32}` does not support indexing +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+4]]:14: error(TypeNotIndexable): type `{.a: i32, .b: i32}` does not support indexing // CHECK:STDERR: var c: i32 = {.a = 1, .b = 2}[0]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var c: i32 = {.a = 1, .b = 2}[0]; -// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:14: error: type `type` does not support indexing +// CHECK:STDERR: fail_invalid_base.carbon:[[@LINE+3]]:14: error(TypeNotIndexable): type `type` does not support indexing // CHECK:STDERR: var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ var d: i32 = {.a: i32, .b: i32}[0]; diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index df327f491e2e4..ea632d7513b26 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_name_not_found.carbon fn Main() { - // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+3]]:16: error: name `a` not found + // CHECK:STDERR: fail_name_not_found.carbon:[[@LINE+3]]:16: error(NameNotFound): name `a` not found // CHECK:STDERR: var b: i32 = a[0]; // CHECK:STDERR: ^ var b: i32 = a[0]; diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index d97c8b281d45d..f09d0a6be08b2 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_negative_indexing.carbon var c: [i32; 2] = (42, 42); -// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: error: cannot access member of interface `Negate` in type `i32` that does not implement that interface +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:16: error(MissingImplInMemberAccess): cannot access member of interface `Negate` in type `i32` that does not implement that interface // CHECK:STDERR: var d: i32 = c[-10]; // CHECK:STDERR: ^~~ var d: i32 = c[-10]; diff --git a/toolchain/check/testdata/index/fail_non_tuple_access.carbon b/toolchain/check/testdata/index/fail_non_tuple_access.carbon index b08bf01991a18..8e336e5be8ccb 100644 --- a/toolchain/check/testdata/index/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_non_tuple_access.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/index/fail_non_tuple_access.carbon fn Main() { - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:3: error: type `i32` does not support indexing + // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:3: error(TypeNotIndexable): type `i32` does not support indexing // CHECK:STDERR: 0[1]; // CHECK:STDERR: ^~~~ 0[1]; diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index 6298e8f984994..bb3d86ad945f2 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon interface I { - // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `i32` to `type` + // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+6]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ - // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: note: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_assoc_const_bad_default.carbon:[[@LINE+3]]:3: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let T:! type = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ let T:! type = 42; diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 68aa2cd8f61b1..a0382e454d97d 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon interface I { - // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` + // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+4]]:3: error(SemanticsTodo): semantics TODO: `interface modifier` // CHECK:STDERR: default let T:! type = (i32, i32); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default let T:! type = (i32, i32); - // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` + // CHECK:STDERR: fail_todo_assoc_const_default.carbon:[[@LINE+3]]:3: error(SemanticsTodo): semantics TODO: `interface modifier` // CHECK:STDERR: default let N:! i32 = 42; // CHECK:STDERR: ^~~~~~~ default let N:! i32 = 42; diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index f5797d5c9fd56..9556039e2223a 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon interface Interface { - // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` + // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+4]]:3: error(SemanticsTodo): semantics TODO: `interface modifier` // CHECK:STDERR: default fn F() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn F() {} - // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` + // CHECK:STDERR: fail_todo_define_default_fn_inline.carbon:[[@LINE+3]]:3: error(SemanticsTodo): semantics TODO: `interface modifier` // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~ default fn G(a: i32, b: i32) -> i32 = "int.sadd"; diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 833158ec82f76..f95cc3647d197 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -11,32 +11,32 @@ // --- fail_todo_define_default_fn_out_of_line.carbon interface Interface { - // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` + // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+4]]:3: error(SemanticsTodo): semantics TODO: `interface modifier` // CHECK:STDERR: default fn F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn F(); - // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` + // CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+4]]:3: error(SemanticsTodo): semantics TODO: `interface modifier` // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32; } -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn Interface.F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-12]]:3: note: name is previously declared here +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-12]]:3: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: default fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: fn Interface.F() {} -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE+6]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-15]]:3: note: name is previously declared here +// CHECK:STDERR: fail_todo_define_default_fn_out_of_line.carbon:[[@LINE-15]]:3: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: default fn G(a: i32, b: i32) -> i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon b/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon index 9362fc583b569..a3683454440bc 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon @@ -10,7 +10,7 @@ interface Interface { } -// CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:14: error: out-of-line declaration requires a declaration in scoped entity +// CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:14: error(QualifiedDeclOutsideScopeEntity): out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn Interface.F() {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -19,13 +19,13 @@ fn Interface.F() {} // Nesting interfaces like this is not valid, but make sure we don't crash. interface Outer { interface Inner { - // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:8: error: name `Outer` not found + // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+4]]:8: error(NameNotFound): name `Outer` not found // CHECK:STDERR: fn Outer.F(); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fn Outer.F(); } - // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+3]]:12: error: out-of-line declaration requires a declaration in scoped entity + // CHECK:STDERR: fail_add_member_outside_definition.carbon:[[@LINE+3]]:12: error(QualifiedDeclOutsideScopeEntity): out-of-line declaration requires a declaration in scoped entity // CHECK:STDERR: fn Inner.F(); // CHECK:STDERR: ^ fn Inner.F(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon index 7be7c18e170fb..a274cb24fc6bd 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon interface I { - // CHECK:STDERR: fail_assoc_const_not_binding.carbon:[[@LINE+3]]:3: error: semantics TODO: `tuple pattern in let/var` + // CHECK:STDERR: fail_assoc_const_not_binding.carbon:[[@LINE+3]]:3: error(SemanticsTodo): semantics TODO: `tuple pattern in let/var` // CHECK:STDERR: let (T:! type, U:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ let (T:! type, U:! type); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon index 0cdadbec53009..605683cd38eda 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon @@ -9,11 +9,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon interface I { - // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+7]]:7: error: pattern in associated constant declaration must be a single `:!` binding + // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+7]]:7: error(ExpectedSymbolicBindingInAssociatedConstant): pattern in associated constant declaration must be a single `:!` binding // CHECK:STDERR: let a: i32; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+3]]:10: error: package `Core` implicitly referenced here, but not found + // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+3]]:10: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: let a: i32; // CHECK:STDERR: ^~~ let a: i32; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon index a5fd68fa1624b..5a14ce7493996 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon interface I { - // CHECK:STDERR: fail_assoc_const_template.carbon:[[@LINE+3]]:7: error: semantics TODO: `HandleTemplate` + // CHECK:STDERR: fail_assoc_const_template.carbon:[[@LINE+3]]:7: error(SemanticsTodo): semantics TODO: `HandleTemplate` // CHECK:STDERR: let template T:! type; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ let template T:! type; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon index f6f6c3043140d..2f7d8da459df4 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon @@ -19,11 +19,11 @@ interface I; library "[[@TEST_NAME]]"; import library "a"; -// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: interface I {} // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: a.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_b.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: a.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: interface I; // CHECK:STDERR: ^~~~~~~~~~~~ interface I {} diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon index c875b3d01b54f..3883cccbefa22 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon @@ -14,10 +14,10 @@ library "[[@TEST_NAME]]"; interface Interface { } -// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE+7]]:1: error: redefinition of `interface Interface` +// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE+7]]:1: error(RedeclRedef): redefinition of `interface Interface` // CHECK:STDERR: interface Interface { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE-5]]:1: note: previously defined here +// CHECK:STDERR: fail_redefine_without_dependents.carbon:[[@LINE-5]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: interface Interface { } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,10 +31,10 @@ library "[[@TEST_NAME]]"; interface Interface {} -// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE+7]]:1: error: redefinition of `interface Interface` +// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE+7]]:1: error(RedeclRedef): redefinition of `interface Interface` // CHECK:STDERR: interface Interface { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE-5]]:1: note: previously defined here +// CHECK:STDERR: fail_redefine_with_dependents.carbon:[[@LINE-5]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: interface Interface {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -48,10 +48,10 @@ library "[[@TEST_NAME]]"; fn Function(); -// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: interface Function; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE-5]]:1: note: name is previously declared here +// CHECK:STDERR: fail_name_conflict_with_fn.carbon:[[@LINE-5]]:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn Function(); // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -61,10 +61,10 @@ interface Function; class Class; -// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE+6]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: interface Class { } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE-5]]:1: note: name is previously declared here +// CHECK:STDERR: fail_name_conflict_with_class.carbon:[[@LINE-5]]:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: class Class; // CHECK:STDERR: ^~~~~~~~~~~~ interface Class { } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon index 978a7dcbf9dd6..5df130ddea42a 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon @@ -9,30 +9,30 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon interface NotGeneric; -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter list +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error(RedeclParamListDiffers): redeclaration differs because of parameter list // CHECK:STDERR: interface NotGeneric(T:! type) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: note: previously declared without parameter list +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: note(RedeclParamListPrevious): previously declared without parameter list // CHECK:STDERR: interface NotGeneric; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: interface NotGeneric(T:! type) {} interface Generic(T:! type); -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error: redeclaration differs because of missing parameter list +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error(RedeclParamListDiffers): redeclaration differs because of missing parameter list // CHECK:STDERR: interface Generic {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: note: previously declared with parameter list +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:1: note(RedeclParamListPrevious): previously declared with parameter list // CHECK:STDERR: interface Generic(T:! type); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: interface Generic {} interface DifferentParams(T:! type); -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+6]]:27: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+6]]:27: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: interface DifferentParams(T:! ()) {} // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:27: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE-4]]:27: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: interface DifferentParams(T:! type); // CHECK:STDERR: ^~~~~~~~ interface DifferentParams(T:! ()) {} diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon index aeb79f4242712..64401231b8eef 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon @@ -10,20 +10,20 @@ interface Undefined; -// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:4: error: cannot declare a member of undefined interface `Undefined` +// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:4: error(QualifiedDeclInUndefinedInterfaceScope): cannot declare a member of undefined interface `Undefined` // CHECK:STDERR: fn Undefined.F(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-5]]:1: note: interface was forward declared here +// CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-5]]:1: note(InterfaceForwardDeclaredHere): interface was forward declared here // CHECK:STDERR: interface Undefined; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: fn Undefined.F(); fn Test() { - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:3: error: member access into undefined interface `Undefined` + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+7]]:3: error(QualifiedExprInUndefinedInterfaceScope): member access into undefined interface `Undefined` // CHECK:STDERR: Undefined.G(); // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-15]]:1: note: interface was forward declared here + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-15]]:1: note(InterfaceForwardDeclaredHere): interface was forward declared here // CHECK:STDERR: interface Undefined; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,19 +31,19 @@ fn Test() { } interface BeingDefined { - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+11]]:13: error: member access into undefined interface `BeingDefined` + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+11]]:13: error(QualifiedExprInUndefinedInterfaceScope): member access into undefined interface `BeingDefined` // CHECK:STDERR: fn H() -> BeingDefined.T; // CHECK:STDERR: ^~~~~~~~~~~~~~ - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-4]]:1: note: interface is currently being defined + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE-4]]:1: note(InterfaceUndefinedWithinDefinition): interface is currently being defined // CHECK:STDERR: interface BeingDefined { // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+4]]:13: error: name `T` not found + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+4]]:13: error(NameNotFound): name `T` not found // CHECK:STDERR: fn H() -> BeingDefined.T; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: fn H() -> BeingDefined.T; - // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+3]]:6: error: name `BeingDefined` not found + // CHECK:STDERR: fail_lookup_undefined.carbon:[[@LINE+3]]:6: error(NameNotFound): name `BeingDefined` not found // CHECK:STDERR: fn BeingDefined.I(); // CHECK:STDERR: ^~~~~~~~~~~~ fn BeingDefined.I(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon index 70b827e72a65d..f7f678553d31f 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon @@ -15,13 +15,13 @@ interface Interface { } fn F() { - // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:3: error: value of type ` in Interface>` is not callable + // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+4]]:3: error(CallToNonCallable): value of type ` in Interface>` is not callable // CHECK:STDERR: Interface.F(); // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: Interface.F(); - // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+3]]:10: error: package `Core` implicitly referenced here, but not found + // CHECK:STDERR: fail_member_lookup.carbon:[[@LINE+3]]:10: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: var v: Interface.T; // CHECK:STDERR: ^~~~~~~~~~~ var v: Interface.T; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon index f1312d583dc55..5fb3680553a42 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon @@ -8,27 +8,27 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `abstract` not allowed on `interface` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `abstract` not allowed on `interface` declaration // CHECK:STDERR: abstract interface Abstract { // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: abstract interface Abstract { } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed on `interface` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `default` not allowed on `interface` declaration // CHECK:STDERR: default interface Default; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default interface Default; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `virtual` not allowed on `interface` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `virtual` not allowed on `interface` declaration // CHECK:STDERR: virtual interface Virtual { // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: virtual interface Virtual { } -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `protected` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error(ModifierProtectedNotAllowed): `protected` not allowed; requires class scope // CHECK:STDERR: protected interface Protected; // CHECK:STDERR: ^~~~~~~~~ protected interface Protected; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon index 91d1e91d66b6f..d01e43aefa56a 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon @@ -10,10 +10,10 @@ interface Interface { fn F(); - // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE+6]]:3: error: duplicate name being declared in the same scope + // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE+6]]:3: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE-4]]:3: note: name is previously declared here + // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE-4]]:3: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn F(); // CHECK:STDERR: ^~~~~~~ fn F(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon index d8660bcd1dbbf..0ce41ad93ce6e 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_facet_lookup.carbon @@ -11,7 +11,7 @@ interface Interface { fn F(); } fn CallStatic(T:! Interface) { - // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: error: value of type ` in Interface>` is not callable + // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+4]]:3: error(CallToNonCallable): value of type ` in Interface>` is not callable // CHECK:STDERR: T.F(); // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -19,7 +19,7 @@ fn CallStatic(T:! Interface) { } fn CallFacet(T:! Interface, x: T) { - // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+3]]:3: error: type `T` does not support qualified expressions + // CHECK:STDERR: fail_todo_facet_lookup.carbon:[[@LINE+3]]:3: error(QualifiedExprUnsupported): type `T` does not support qualified expressions // CHECK:STDERR: x.F(); // CHECK:STDERR: ^~~ x.F(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon index f0faf87e48ecc..347cd9a964790 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon @@ -13,10 +13,10 @@ interface I(T:! type) { fn F[self: Self]() -> Self; } -// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE+6]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE+6]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn I(T:! type).F[self: Self]() -> Self { return self; } // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE-6]]:3: note: name is previously declared here +// CHECK:STDERR: fail_todo_generic_default_fn.carbon:[[@LINE-6]]:3: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn F[self: Self]() -> Self; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ fn I(T:! type).F[self: Self]() -> Self { return self; } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon b/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon index 7f7e9f1817e79..338c75f6bf60b 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon interface Modifiers { - // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` + // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+4]]:3: error(SemanticsTodo): semantics TODO: `interface modifier` // CHECK:STDERR: final fn Final() { } // CHECK:STDERR: ^~~~~ // CHECK:STDERR: final fn Final() { } - // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+3]]:3: error: semantics TODO: `interface modifier` + // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+3]]:3: error(SemanticsTodo): semantics TODO: `interface modifier` // CHECK:STDERR: default fn Default() { } // CHECK:STDERR: ^~~~~~~ default fn Default() { } diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/no_prelude/generic.carbon index 8e5a53adf2e0b..03ca18102e5ac 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic.carbon @@ -49,10 +49,10 @@ class B {} fn F(T:! Generic(A)); fn G(T:! Generic(B)) { // TODO: Include generic arguments in the type name. - // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+6]]:3: error: package `Core` implicitly referenced here, but not found + // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE+6]]:3: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: F(T); // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here + // CHECK:STDERR: fail_mismatched_args.carbon:[[@LINE-6]]:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: fn F(T:! Generic(A)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ F(T); diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon index 909b13ab38f61..2bd92b0a5f8d3 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon @@ -32,7 +32,7 @@ impl X as C(X).GenericAndParams(X) {} library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:13: error: parameters of generic types must be constant +// CHECK:STDERR: fail_non_generic_implicit_params.carbon:[[@LINE+4]]:13: error(GenericParamMustBeConstant): parameters of generic types must be constant // CHECK:STDERR: interface A[T: type]() {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ interface A[T: type]() {} library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:13: error: parameters of generic types must be constant +// CHECK:STDERR: fail_non_generic_params.carbon:[[@LINE+3]]:13: error(GenericParamMustBeConstant): parameters of generic types must be constant // CHECK:STDERR: interface A(T: type) {} // CHECK:STDERR: ^~~~~~~ interface A(T: type) {} diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index e0d20d2fee3c8..a7ac1f61ee4fb 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -49,7 +49,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:9: error: name `Def` not found +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:9: error(NameNotFound): name `Def` not found // CHECK:STDERR: fn F(i: Def) {} // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -61,7 +61,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:9: error: name `Def` not found +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:9: error(NameNotFound): name `Def` not found // CHECK:STDERR: fn F(i: Test.Def) {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -79,7 +79,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward_with_def"; -// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:9: error: name `ForwardWithDef` not found +// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:9: error(NameNotFound): name `ForwardWithDef` not found // CHECK:STDERR: fn F(i: ForwardWithDef) {} // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -91,7 +91,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward_with_def"; -// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:9: error: name `ForwardWithDef` not found +// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:9: error(NameNotFound): name `ForwardWithDef` not found // CHECK:STDERR: fn F(i: Test.ForwardWithDef) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -101,7 +101,7 @@ fn F(i: Test.ForwardWithDef) {} impl package Test library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+4]]:9: error: name `Forward` not found +// CHECK:STDERR: fail_todo_forward.impl.carbon:[[@LINE+4]]:9: error(NameNotFound): name `Forward` not found // CHECK:STDERR: fn F(i: Forward*) {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -115,7 +115,7 @@ package Test library "[[@TEST_NAME]]"; import library "forward"; -// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error: name `Forward` not found +// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:9: error(NameNotFound): name `Forward` not found // CHECK:STDERR: fn F(i: Forward*) {} // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -127,7 +127,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "forward"; -// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error: name `Forward` not found +// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+3]]:9: error(NameNotFound): name `Forward` not found // CHECK:STDERR: fn F(i: Forward*) {} // CHECK:STDERR: ^~~~~~~ fn F(i: Forward*) {} diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon index c668c6dc148ea..af9af796a6ab1 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon @@ -37,10 +37,10 @@ library "[[@TEST_NAME]]"; class C {} interface Foo(a:! C); -// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here +// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:19: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! (C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:19: note: comparing with previous declaration here +// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:19: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -69,20 +69,20 @@ interface Bar(a:! D); impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+8]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: interface Foo(a:! C) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: two_file.carbon:7:1: note: name is previously declared here +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: two_file.carbon:7:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: interface Foo(a:! C) {} -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+8]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: interface Bar(a:! D) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-14]]:6: in import -// CHECK:STDERR: two_file.carbon:8:1: note: name is previously declared here +// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE-14]]:6(InImport): in import +// CHECK:STDERR: two_file.carbon:8:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: interface Bar(a:! D); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -96,10 +96,10 @@ class C {} alias D = C; interface Foo(a:! C); -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration differs at parameter 1 +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:15: error(RedeclParamDiffers): redeclaration differs at parameter 1 // CHECK:STDERR: interface Foo(b:! D) {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:15: note: previous declaration's corresponding parameter here +// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:15: note(RedeclParamPrevious): previous declaration's corresponding parameter here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -113,10 +113,10 @@ class C {} alias D = C; interface Foo(a:! C); -// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here +// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:19: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! D) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:19: note: comparing with previous declaration here +// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:19: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -130,10 +130,10 @@ class C {} alias D = C; interface Foo[a:! C](); -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:19: error: redeclaration syntax differs here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:19: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: interface Foo[a:! D]() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:19: note: comparing with previous declaration here +// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:19: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: interface Foo[a:! C](); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -156,11 +156,11 @@ alias D = C; // TODO: This fails because importing interfaces doesn't work well. It should // fail due to `C` versus `D`, but may succeed if importing interfaces is fixed // before syntax matching on imports is supported. -// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE+8]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: interface Foo(a:! D) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE-10]]:6: in import -// CHECK:STDERR: alias_two_file.carbon:6:1: note: name is previously declared here +// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE-10]]:6(InImport): in import +// CHECK:STDERR: alias_two_file.carbon:6:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: interface Foo(a:! C); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -173,14 +173,14 @@ library "[[@TEST_NAME]]"; class C {} interface Foo(a:! const C); -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:19: warning: `const` applied repeatedly to the same type has no additional effect +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+10]]:19: warning(RepeatedConst): `const` applied repeatedly to the same type has no additional effect // CHECK:STDERR: interface Foo(a:! const (const C)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:25: error: redeclaration syntax differs here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+6]]:25: error(RedeclParamSyntaxDiffers): redeclaration syntax differs here // CHECK:STDERR: interface Foo(a:! const (const C)) {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:25: note: comparing with previous declaration here +// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:25: note(RedeclParamSyntaxPrevious): comparing with previous declaration here // CHECK:STDERR: interface Foo(a:! const C); // CHECK:STDERR: ^ interface Foo(a:! const (const C)) {} diff --git a/toolchain/check/testdata/let/compile_time_bindings.carbon b/toolchain/check/testdata/let/compile_time_bindings.carbon index 36ab05789a8f6..43935d753507e 100644 --- a/toolchain/check/testdata/let/compile_time_bindings.carbon +++ b/toolchain/check/testdata/let/compile_time_bindings.carbon @@ -18,7 +18,7 @@ library "[[@TEST_NAME]]"; class C { fn F() -> () { return x; } - // CHECK:STDERR: fail_let_after.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` + // CHECK:STDERR: fail_let_after.carbon:[[@LINE+4]]:7: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let x:! () = (); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -30,7 +30,7 @@ class C { library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_let_before.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` + // CHECK:STDERR: fail_let_before.carbon:[[@LINE+4]]:7: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let x:! () = (); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -43,7 +43,7 @@ class C { library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` + // CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+4]]:7: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let a:! () = (); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -56,7 +56,7 @@ class C { var c1: ((), ()) = c; var d1: ((), (), ()) = d; } - // CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` + // CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+4]]:7: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let d:! ((), (), ()) = ((), (), ()); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -69,11 +69,11 @@ library "[[@TEST_NAME]]"; class C { fn F() -> () { return x; } - // CHECK:STDERR: fail_invalid_let_after.carbon:[[@LINE+8]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` + // CHECK:STDERR: fail_invalid_let_after.carbon:[[@LINE+8]]:7: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let x:! (); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_invalid_let_after.carbon:[[@LINE+4]]:13: error: expected `=`; `let` declaration must have an initializer + // CHECK:STDERR: fail_invalid_let_after.carbon:[[@LINE+4]]:13: error(ExpectedInitializerAfterLet): expected `=`; `let` declaration must have an initializer // CHECK:STDERR: let x:! (); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -107,10 +107,10 @@ library "[[@TEST_NAME]]"; interface I { let T:! type = i32; - // CHECK:STDERR: fail_return_in_interface.carbon:[[@LINE+7]]:13: error: cannot implicitly convert from `` to `type` + // CHECK:STDERR: fail_return_in_interface.carbon:[[@LINE+7]]:13: error(ImplicitAsConversionFailure): cannot implicitly convert from `` to `type` // CHECK:STDERR: fn F() -> T; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_return_in_interface.carbon:[[@LINE+4]]:13: note: type `` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_return_in_interface.carbon:[[@LINE+4]]:13: note(MissingImplInMemberAccessNote): type `` does not implement interface `ImplicitAs` // CHECK:STDERR: fn F() -> T; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -122,12 +122,12 @@ interface I { library "[[@TEST_NAME]]"; class I { - // CHECK:STDERR: fail_return_in_class.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` + // CHECK:STDERR: fail_return_in_class.carbon:[[@LINE+4]]:7: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let T:! type = i32; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: let T:! type = i32; - // CHECK:STDERR: fail_return_in_class.carbon:[[@LINE+4]]:13: error: cannot evaluate type expression + // CHECK:STDERR: fail_return_in_class.carbon:[[@LINE+4]]:13: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: fn F() -> T; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -138,12 +138,12 @@ class I { library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_return_in_package_scope.carbon:[[@LINE+4]]:5: error: semantics TODO: ``let` compile time binding outside function or interface` +// CHECK:STDERR: fail_return_in_package_scope.carbon:[[@LINE+4]]:5: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let T:! type = i32; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: let T:! type = i32; -// CHECK:STDERR: fail_return_in_package_scope.carbon:[[@LINE+4]]:11: error: cannot evaluate type expression +// CHECK:STDERR: fail_return_in_package_scope.carbon:[[@LINE+4]]:11: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: fn F() -> T; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -156,7 +156,7 @@ library "[[@TEST_NAME]]"; interface Empty {} impl i32 as Empty { - // CHECK:STDERR: fail_use_in_impl.carbon:[[@LINE+3]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` + // CHECK:STDERR: fail_use_in_impl.carbon:[[@LINE+3]]:7: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let Zero:! i32 = 0; // CHECK:STDERR: ^~~~~~~~~~ let Zero:! i32 = 0; diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index 72017a91be2c6..af62635b8f08a 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -10,10 +10,10 @@ fn F() { let a: i32 = 1; - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: let a: i32 = 2; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note: name is previously declared here + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: let a: i32 = 1; // CHECK:STDERR: ^ let a: i32 = 2; diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 295d30cd6beb6..284c64bfb9d4f 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -11,18 +11,18 @@ // TODO: Should this be valid? fn F(a: i32) -> i32 { let T:! type = i32; - // CHECK:STDERR: fail_generic.carbon:[[@LINE+7]]:3: error: cannot implicitly convert from `i32` to `T` + // CHECK:STDERR: fail_generic.carbon:[[@LINE+7]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `T` // CHECK:STDERR: let x: T = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: note: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_generic.carbon:[[@LINE+4]]:3: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: let x: T = 5; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: let x: T = 5; - // CHECK:STDERR: fail_generic.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `T` to `i32` + // CHECK:STDERR: fail_generic.carbon:[[@LINE+6]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `T` to `i32` // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: note: type `` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:3: note(MissingImplInMemberAccessNote): type `` does not implement interface `ImplicitAs` // CHECK:STDERR: return x; // CHECK:STDERR: ^~~~~~~~~ return x; diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index 412b26c0a68e7..265f22534571a 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -12,7 +12,7 @@ package Implicit; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:5: error: semantics TODO: ``let` compile time binding outside function or interface` +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:5: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let T:! type = i32; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -23,7 +23,7 @@ let T:! type = i32; impl package Implicit; // TODO: Should this be valid? -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:8: error: cannot evaluate type expression +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:8: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: let a: T = 0; // CHECK:STDERR: ^ let a: T = 0; diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index 23c35024130a7..5ef03a1dd8da1 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -8,14 +8,14 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_missing_value.carbon -// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+4]]:11: error: expected `=`; `let` declaration must have an initializer +// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+4]]:11: error(ExpectedInitializerAfterLet): expected `=`; `let` declaration must have an initializer // CHECK:STDERR: let n: i32; // CHECK:STDERR: ^ // CHECK:STDERR: let n: i32; fn F() { - // CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:13: error: expected `=`; `let` declaration must have an initializer + // CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:13: error(ExpectedInitializerAfterLet): expected `=`; `let` declaration must have an initializer // CHECK:STDERR: let n: i32; // CHECK:STDERR: ^ let n: i32; diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index b863d8a358a26..4f448eac3e74d 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -8,77 +8,77 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierProtectedNotAllowed): `protected` not allowed; requires class scope // CHECK:STDERR: protected let b: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: protected let b: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed; requires interface scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierRequiresInterface): `default` not allowed; requires interface scope // CHECK:STDERR: default let c: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default let c: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `final` not allowed; requires interface scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierRequiresInterface): `final` not allowed; requires interface scope // CHECK:STDERR: final let d: i32 = 1; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: final let d: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `virtual` not allowed on `let` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `virtual` not allowed on `let` declaration // CHECK:STDERR: virtual let e: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: virtual let e: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `default` not allowed; requires interface scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error(ModifierRequiresInterface): `default` not allowed; requires interface scope // CHECK:STDERR: default final let f: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `final` not allowed on declaration with `default` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error(ModifierNotAllowedWith): `final` not allowed on declaration with `default` // CHECK:STDERR: default final let f: i32 = 1; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `default` previously appeared here // CHECK:STDERR: default final let f: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default final let f: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `default` not allowed; requires interface scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error(ModifierRequiresInterface): `default` not allowed; requires interface scope // CHECK:STDERR: default default let g: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `default` repeated on declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error(ModifierRepeated): `default` repeated on declaration // CHECK:STDERR: default default let g: i32 = 1; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `default` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `default` previously appeared here // CHECK:STDERR: default default let g: i32 = 1; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default default let g: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `protected` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error(ModifierProtectedNotAllowed): `protected` not allowed; requires class scope // CHECK:STDERR: protected private let h: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: error: `private` not allowed on declaration with `protected` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: error(ModifierNotAllowedWith): `private` not allowed on declaration with `protected` // CHECK:STDERR: protected private let h: i32 = 1; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `protected` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `protected` previously appeared here // CHECK:STDERR: protected private let h: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: protected private let h: i32 = 1; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+10]]:1: error: `protected` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+10]]:1: error(ModifierProtectedNotAllowed): `protected` not allowed; requires class scope // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:11: error: `protected` repeated on declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+6]]:11: error(ModifierRepeated): `protected` repeated on declaration // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: note: `protected` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: note(ModifierPrevious): `protected` previously appeared here // CHECK:STDERR: protected protected let i: i32 = 1; // CHECK:STDERR: ^~~~~~~~~ protected protected let i: i32 = 1; diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index 14a51c0c75e06..0eda57a86fabb 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/fail_use_in_init.carbon fn F() { - // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+3]]:16: error: name `a` not found + // CHECK:STDERR: fail_use_in_init.carbon:[[@LINE+3]]:16: error(NameNotFound): name `a` not found // CHECK:STDERR: let a: i32 = a; // CHECK:STDERR: ^ let a: i32 = a; diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index 610554b44ba4d..703d5d9df5200 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -12,7 +12,7 @@ package Implicit; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:5: error: semantics TODO: ``let` compile time binding outside function or interface` +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:5: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let T:! type = i32; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -22,12 +22,12 @@ let T:! type = i32; impl package Implicit; -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:8: error: cannot evaluate type expression +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:8: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var a: T*; // CHECK:STDERR: ^~ // CHECK:STDERR: var a: T*; -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:8: error: cannot evaluate type expression +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:8: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var b: T = *a; // CHECK:STDERR: ^ var b: T = *a; diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index c2b451cf46f27..adb973ed2cf48 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -34,7 +34,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:14: error: name `v` not found +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:14: error(NameNotFound): name `v` not found // CHECK:STDERR: let v2: () = v; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -46,7 +46,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: name `v` not found +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error(NameNotFound): name `v` not found // CHECK:STDERR: let v2: () = Test.v; // CHECK:STDERR: ^~~~~~ let v2: () = Test.v; diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index 36d995eb9d573..d4cf154be7f35 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -24,11 +24,11 @@ import library "namespace"; // imported declaration. namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-9]]:1: in import -// CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-9]]:1(InImport): in import +// CHECK:STDERR: namespace.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -38,11 +38,11 @@ fn NS(); // we don't move it. namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-23]]:1: in import -// CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-23]]:1(InImport): in import +// CHECK:STDERR: namespace.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ fn NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index 579828c977f89..d355f3059748e 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -20,11 +20,11 @@ package Example; import library "namespace"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: namespace.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ fn NS(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon index 7c110cf0bf653..1f469fe3b484f 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_nested.carbon @@ -16,19 +16,19 @@ namespace Nested; // --- fail_conflict.carbon import Other; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-4]]:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-4]]:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: import Other; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: namespace Other; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:10: error: imported packages cannot be used for declarations +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:10: error(QualifiedDeclOutsidePackage): imported packages cannot be used for declarations // CHECK:STDERR: fn Other.Nested.F(); // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-12]]:1: in import -// CHECK:STDERR: fn.carbon:3:1: note: package imported here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-12]]:1(InImport): in import +// CHECK:STDERR: fn.carbon:3:1: note(QualifiedDeclOutsidePackageSource): package imported here // CHECK:STDERR: namespace Nested; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ fn Other.Nested.F(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index 76c84f2c4ee89..d842d4638fbb8 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -20,21 +20,21 @@ package Example; import library "fn"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: fn.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: fn.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: namespace NS; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:4: error: name qualifiers are only allowed for entities that provide a scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:4: error(QualifiedNameInNonScope): name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn NS.Foo(); // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE-15]]:1: in import -// CHECK:STDERR: fn.carbon:4:1: note: referenced non-scope entity declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE-15]]:1(InImport): in import +// CHECK:STDERR: fn.carbon:4:1: note(QualifiedNameNonScopeEntity): referenced non-scope entity declared here // CHECK:STDERR: fn NS(); // CHECK:STDERR: ^~~~~~~~ fn NS.Foo(); diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index 4d481b2a0b301..4f113c825521b 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -25,12 +25,12 @@ fn NS() {} package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: fn.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: fn.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn NS() {} // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: namespace.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: namespace.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ import library "namespace"; diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index 08893a9efe045..5e3ce84ec992b 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -25,12 +25,12 @@ fn NS.Foo() {} package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: namespace.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: namespace.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: fn.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: fn.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn NS() {} // CHECK:STDERR: ^~~~~~~~~ import library "fn"; diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 1481843079fb9..35ba7b6c324ed 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -13,10 +13,10 @@ namespace NS; alias ns = NS; // Aliases can't be used when declaring names. -// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE+6]]:4: error: name qualifiers are only allowed for entities that provide a scope +// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE+6]]:4: error(QualifiedNameInNonScope): name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: fn ns.A() -> i32 { return 0; } // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE-6]]:7: note: referenced non-scope entity declared here +// CHECK:STDERR: fail_decl_in_alias.carbon:[[@LINE-6]]:7: note(QualifiedNameNonScopeEntity): referenced non-scope entity declared here // CHECK:STDERR: alias ns = NS; // CHECK:STDERR: ^~ fn ns.A() -> i32 { return 0; } diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index 82e2636aa5ac7..1c649483bf3d3 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -13,10 +13,10 @@ namespace Foo; fn Foo.Baz() { } -// CHECK:STDERR: fail_duplicate.carbon:[[@LINE+6]]:1: error: redefinition of `fn Baz` +// CHECK:STDERR: fail_duplicate.carbon:[[@LINE+6]]:1: error(RedeclRedef): redefinition of `fn Baz` // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_duplicate.carbon:[[@LINE-6]]:1: note: previously defined here +// CHECK:STDERR: fail_duplicate.carbon:[[@LINE-6]]:1: note(RedeclPrevDef): previously defined here // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~~~~~~~~~~~~ fn Foo.Baz() { diff --git a/toolchain/check/testdata/namespace/fail_modifiers.carbon b/toolchain/check/testdata/namespace/fail_modifiers.carbon index 5981ec09d1a1c..4039f18b5a4da 100644 --- a/toolchain/check/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/check/testdata/namespace/fail_modifiers.carbon @@ -8,48 +8,48 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/namespace/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+33]]:1: error: `private` not allowed on `namespace` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+33]]:1: error(ModifierNotAllowedOnDeclaration): `private` not allowed on `namespace` declaration // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+29]]:9: error: `extern` not allowed on `namespace` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+29]]:9: error(ModifierNotAllowedOnDeclaration): `extern` not allowed on `namespace` declaration // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:16: error: `abstract` not allowed on `namespace` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+25]]:16: error(ModifierNotAllowedOnDeclaration): `abstract` not allowed on `namespace` declaration // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:25: error: `base` not allowed on declaration with `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+21]]:25: error(ModifierNotAllowedWith): `base` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:16: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:16: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:30: error: `default` not allowed on declaration with `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+14]]:30: error(ModifierNotAllowedWith): `default` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:16: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:16: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:38: error: `final` not allowed on declaration with `abstract` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:38: error(ModifierNotAllowedWith): `final` not allowed on declaration with `abstract` // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:16: note: `abstract` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:16: note(ModifierPrevious): `abstract` previously appeared here // CHECK:STDERR: private extern abstract base default final namespace A; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: private extern abstract base default final namespace A; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `impl` not allowed on `namespace` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `impl` not allowed on `namespace` declaration // CHECK:STDERR: impl namespace B; // CHECK:STDERR: ^~~~ // CHECK:STDERR: impl namespace B; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `extern` not allowed on `namespace` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error(ModifierNotAllowedOnDeclaration): `extern` not allowed on `namespace` declaration // CHECK:STDERR: extern namespace C; // CHECK:STDERR: ^~~~~~ extern namespace C; diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index 13a527935ca58..abc46c75077ac 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/namespace/fail_params.carbon -// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error: `namespace` declaration cannot have parameters +// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error(UnexpectedDeclNameParams): `namespace` declaration cannot have parameters // CHECK:STDERR: namespace A(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -17,23 +17,23 @@ namespace A(); // Parameters are ignored for error recovery. fn A.F() {} -// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error: `namespace` declaration cannot have parameters +// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error(UnexpectedDeclNameParams): `namespace` declaration cannot have parameters // CHECK:STDERR: namespace B(n: i32); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: namespace B(n: i32); -// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error: `namespace` declaration cannot have parameters +// CHECK:STDERR: fail_params.carbon:[[@LINE+4]]:12: error(UnexpectedDeclNameParams): `namespace` declaration cannot have parameters // CHECK:STDERR: namespace C[T:! type](x: T); // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: namespace C[T:! type](x: T); namespace D; -// CHECK:STDERR: fail_params.carbon:[[@LINE+6]]:4: error: redeclaration differs because of parameter list +// CHECK:STDERR: fail_params.carbon:[[@LINE+6]]:4: error(RedeclParamListDiffers): redeclaration differs because of parameter list // CHECK:STDERR: fn D(T:! type).F() {} // CHECK:STDERR: ^ -// CHECK:STDERR: fail_params.carbon:[[@LINE-4]]:1: note: previously declared without parameter list +// CHECK:STDERR: fail_params.carbon:[[@LINE-4]]:1: note(RedeclParamListPrevious): previously declared without parameter list // CHECK:STDERR: namespace D; // CHECK:STDERR: ^~~~~~~~~~~~ fn D(T:! type).F() {} diff --git a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon index 7eaf8888ebb33..c754662d65f34 100644 --- a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon +++ b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/namespace/fail_unresolved_scope.carbon -// CHECK:STDERR: fail_unresolved_scope.carbon:[[@LINE+3]]:4: error: name `Foo` not found +// CHECK:STDERR: fail_unresolved_scope.carbon:[[@LINE+3]]:4: error(NameNotFound): name `Foo` not found // CHECK:STDERR: fn Foo.Baz() { // CHECK:STDERR: ^~~ fn Foo.Baz() { diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index ac0753824f79c..015cadb69a705 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -14,29 +14,29 @@ fn F(b: bool) -> type { } // TODO: Short-circuit operators should be permitted outside functions. -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+12]]:11: error: cannot evaluate type expression +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+12]]:11: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var and_: F(true and true); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+8]]:13: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var and_: F(true and true); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+4]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+4]]:13: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var and_: F(true and true); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: var and_: F(true and true); -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+11]]:10: error: cannot evaluate type expression +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+11]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var or_: F(true or true); // CHECK:STDERR: ^~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+7]]:12: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+7]]:12: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var or_: F(true or true); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+3]]:12: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_and_or_not_in_function.carbon:[[@LINE+3]]:12: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var or_: F(true or true); // CHECK:STDERR: ^~~~~~~~~~~~ var or_: F(true or true); diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon index cdd5199a6bbf5..84091a1f534a8 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon @@ -13,12 +13,12 @@ package FailNonConstantResult; fn PartialConstant(x: bool) { - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var a: if true and x then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var a: if true and x then bool else (); - // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression + // CHECK:STDERR: fail_non_constant_result.carbon:[[@LINE+4]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var b: if false or x then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -32,12 +32,12 @@ package FailDespiteKnownResult; fn KnownValueButNonConstantCondition(x: bool) { // We choose not to give these cases constant values, even though we could, // because they notionally involve evaluating a non-constant condition. - // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression + // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+4]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var c: if x and false then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: var c: if x and false then bool else (); - // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+3]]:10: error: cannot evaluate type expression + // CHECK:STDERR: fail_despite_known_result.carbon:[[@LINE+3]]:10: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: var d: if x or true then bool else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var d: if x or true then bool else (); diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon index cbfcea0d27359..b6739c0beec54 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon fn Main() { - // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+4]]:3: error: name `undeclared` not found + // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+4]]:3: error(NameNotFound): name `undeclared` not found // CHECK:STDERR: undeclared = 42; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: undeclared = 42; - // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+3]]:4: error: name `also_undeclared` not found + // CHECK:STDERR: fail_assignment_to_error.carbon:[[@LINE+3]]:4: error(NameNotFound): name `also_undeclared` not found // CHECK:STDERR: *also_undeclared = 42; // CHECK:STDERR: ^~~~~~~~~~~~~~~ *also_undeclared = 42; diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index cf8c24e9d1b91..8827670c2e02a 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -11,38 +11,38 @@ fn F() -> i32; fn Main() { - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: 1 = 2; // CHECK:STDERR: ^ // CHECK:STDERR: 1 = 2; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: F() = 1; // CHECK:STDERR: ^~~ // CHECK:STDERR: F() = 1; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: (1, 2) = (3, 4); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: (1, 2) = (3, 4); var n: i32 = 0; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: (n, n) = (1, 2); // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: (n, n) = (1, 2); - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: i32 = i32*; // CHECK:STDERR: ^~~ // CHECK:STDERR: i32 = i32*; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: {.x = 1, .y = 2} = {.x = 3, .y = 4}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: {.x = 1, .y = 2} = {.x = 3, .y = 4}; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error: expression is not assignable + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+4]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: (if true then 1 else 2) = 3; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -50,7 +50,7 @@ fn Main() { // Under #911, if expressions are never reference expressions. var a: i32; - // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+3]]:3: error: expression is not assignable + // CHECK:STDERR: fail_assignment_to_non_assignable.carbon:[[@LINE+3]]:3: error(AssignmentToNonAssignable): expression is not assignable // CHECK:STDERR: (if true then a else a) = 10; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ (if true then a else a) = 10; diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index 9d6d3ce41d5d7..9a210dbebaa6b 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -12,12 +12,12 @@ fn F() -> i32 { return 0; } fn Main() { var a: i32 = 3; - // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+4]]:7: error: member name of type `i32` in compound member access is not an instance member or an interface member + // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+4]]:7: error(CompoundMemberAccessDoesNotUseBase): member name of type `i32` in compound member access is not an instance member or an interface member // CHECK:STDERR: a = a.(a); // CHECK:STDERR: ^~~~~ // CHECK:STDERR: a = a.(a); - // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+3]]:7: error: member name of type `` in compound member access is not an instance member or an interface member + // CHECK:STDERR: fail_redundant_compound_access.carbon:[[@LINE+3]]:7: error(CompoundMemberAccessDoesNotUseBase): member name of type `` in compound member access is not an instance member or an interface member // CHECK:STDERR: a = a.(F)(); // CHECK:STDERR: ^~~~~ a = a.(F)(); diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index e8a6928a1ff10..9bc56a7c28f54 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon fn Main() { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `i32` to `bool` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:17: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `bool` // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: note: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:17: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: bool = not 12; // CHECK:STDERR: ^~~~~~ var x: bool = not 12; diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index f5fd3d7c25fed..6029a64b70bb1 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -10,10 +10,10 @@ fn Main() { var a: i32 = 3; - // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` + // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+6]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_type_mismatch_assignment.carbon:[[@LINE+3]]:3: note(MissingImplInMemberAccessNote): type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: a = 5.6; // CHECK:STDERR: ^~~~~~~ a = 5.6; diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index 4e0b2751e282d..e35e76518a9d7 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -11,11 +11,11 @@ fn Main() -> i32 { // The following line has two mismatches, but after the first, it shouldn't // keep erroring. - // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+7]]:10: error: cannot access member of interface `Add` in type `i32` that does not implement that interface + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+7]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Add` in type `i32` that does not implement that interface // CHECK:STDERR: return 12 + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Add` in type `` that does not implement that interface + // CHECK:STDERR: fail_type_mismatch_once.carbon:[[@LINE+3]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Add` in type `` that does not implement that interface // CHECK:STDERR: return 12 + 3.4 + 12; // CHECK:STDERR: ^~~~~~~~~~~~~ return 12 + 3.4 + 12; diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index 8f37bc3747901..4b53bf368a20b 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Add` in type `i32` that does not implement that interface + // CHECK:STDERR: fail_unimplemented_op.carbon:[[@LINE+3]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Add` in type `i32` that does not implement that interface // CHECK:STDERR: return 12 + 34; // CHECK:STDERR: ^~~~~~~ return 12 + 34; diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index b4a3b0bf209ce..b4351888a5c8d 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -34,7 +34,7 @@ package FailNoImpl; class D {}; fn TestEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Eq` in type `D` that does not implement that interface // CHECK:STDERR: return a == b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ fn TestEqual(a: D, b: D) -> bool { } fn TestNotEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Eq` in type `D` that does not implement that interface // CHECK:STDERR: return a != b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -62,13 +62,13 @@ impl C as Core.Eq { } fn TestRhsBad(a: C, b: D) -> bool { - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+10]]:15: error: cannot implicitly convert from `D` to `C` + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+10]]:15: error(ImplicitAsConversionFailure): cannot implicitly convert from `D` to `C` // CHECK:STDERR: return a == b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:15: note: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+7]]:15: note(MissingImplInMemberAccessNote): type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: return a == b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-11]]:21: note: initializing function parameter + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE-11]]:21: note(InCallToFunctionParam): initializing function parameter // CHECK:STDERR: fn Equal[self: C](other: C) -> bool; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -76,7 +76,7 @@ fn TestRhsBad(a: C, b: D) -> bool { } fn TestLhsBad(a: D, b: C) -> bool { - // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Eq` in type `D` that does not implement that interface + // CHECK:STDERR: fail_no_impl_for_args.carbon:[[@LINE+3]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Eq` in type `D` that does not implement that interface // CHECK:STDERR: return a != b; // CHECK:STDERR: ^~~~~~ return a != b; diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index f0138491b3ec6..05a9e18b8c166 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -20,10 +20,10 @@ impl C as Core.AddAssign { } fn TestIncNonRef(a: C) { - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+7]]:5: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+7]]:5: error(AddrSelfIsNonRef): `addr self` method cannot be invoked on a value // CHECK:STDERR: ++a; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:9: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-10]]:9: note(InCallToFunctionSelf): initializing `addr self` parameter of method declared here // CHECK:STDERR: fn Op[addr self: C*](); // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -31,10 +31,10 @@ fn TestIncNonRef(a: C) { } fn TestAddAssignNonRef(a: C, b: C) { - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+6]]:3: error: `addr self` method cannot be invoked on a value + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE+6]]:3: error(AddrSelfIsNonRef): `addr self` method cannot be invoked on a value // CHECK:STDERR: a += b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:9: note: initializing `addr self` parameter of method declared here + // CHECK:STDERR: fail_assign_non_ref.carbon:[[@LINE-18]]:9: note(InCallToFunctionSelf): initializing `addr self` parameter of method declared here // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~~~~~~~~~~ a += b; diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index fac71b58a25cd..747fdcc25ec8e 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -13,7 +13,7 @@ package User; class C {}; fn TestUnary(a: C) -> C { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Negate` in type `C` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Negate` in type `C` that does not implement that interface // CHECK:STDERR: return -a; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -21,7 +21,7 @@ fn TestUnary(a: C) -> C { } fn TestBinary(a: C, b: C) -> C { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Add` in type `C` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Add` in type `C` that does not implement that interface // CHECK:STDERR: return a + b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -30,12 +30,12 @@ fn TestBinary(a: C, b: C) -> C { fn TestRef(b: C) { var a: C = {}; - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:3: error: cannot access member of interface `AddAssign` in type `C` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:3: error(MissingImplInMemberAccess): cannot access member of interface `AddAssign` in type `C` that does not implement that interface // CHECK:STDERR: a += b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: a += b; - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:3: error: cannot access member of interface `Inc` in type `C` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:3: error(MissingImplInMemberAccess): cannot access member of interface `Inc` in type `C` that does not implement that interface // CHECK:STDERR: ++a; // CHECK:STDERR: ^~~ ++a; diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 0d1dc48ab611a..d4b34b395a787 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -21,13 +21,13 @@ impl C as Core.AddAssign { } fn Test(a: C, b: D) -> C { - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:14: error: cannot implicitly convert from `D` to `C` + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+10]]:14: error(ImplicitAsConversionFailure): cannot implicitly convert from `D` to `C` // CHECK:STDERR: return a + b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:14: note: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+7]]:14: note(MissingImplInMemberAccessNote): type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: return a + b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-13]]:18: note: initializing function parameter + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-13]]:18: note(InCallToFunctionParam): initializing function parameter // CHECK:STDERR: fn Op[self: C](other: C) -> C; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -36,13 +36,13 @@ fn Test(a: C, b: D) -> C { fn TestAssign(b: D) { var a: C = {}; - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:8: error: cannot implicitly convert from `D` to `C` + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+9]]:8: error(ImplicitAsConversionFailure): cannot implicitly convert from `D` to `C` // CHECK:STDERR: a += b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:8: note: type `D` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE+6]]:8: note(MissingImplInMemberAccessNote): type `D` does not implement interface `ImplicitAs` // CHECK:STDERR: a += b; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:24: note: initializing function parameter + // CHECK:STDERR: fail_no_impl_for_arg.carbon:[[@LINE-25]]:24: note(InCallToFunctionParam): initializing function parameter // CHECK:STDERR: fn Op[addr self: C*](other: C); // CHECK:STDERR: ^~~~~~~~ a += b; diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index f903fb06bb421..89ed601ba5d75 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -44,7 +44,7 @@ package FailNoImpl; class D {}; fn TestLess(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Ordered` in type `D` that does not implement that interface // CHECK:STDERR: return a < b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ fn TestLess(a: D, b: D) -> bool { } fn TestLessEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Ordered` in type `D` that does not implement that interface // CHECK:STDERR: return a <= b; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -60,7 +60,7 @@ fn TestLessEqual(a: D, b: D) -> bool { } fn TestGreater(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+4]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Ordered` in type `D` that does not implement that interface // CHECK:STDERR: return a > b; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ fn TestGreater(a: D, b: D) -> bool { } fn TestGreaterEqual(a: D, b: D) -> bool { - // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:10: error: cannot access member of interface `Ordered` in type `D` that does not implement that interface + // CHECK:STDERR: fail_no_impl.carbon:[[@LINE+3]]:10: error(MissingImplInMemberAccess): cannot access member of interface `Ordered` in type `D` that does not implement that interface // CHECK:STDERR: return a >= b; // CHECK:STDERR: ^~~~~~ return a >= b; diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index c409f9ab89153..37a627face22a 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/package_expr/fail_not_found.carbon fn Main() { - // CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:16: error: name `x` not found + // CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:16: error(NameNotFound): name `x` not found // CHECK:STDERR: var y: i32 = package.x; // CHECK:STDERR: ^~~~~~~~~ var y: i32 = package.x; diff --git a/toolchain/check/testdata/packages/fail_api_not_found.carbon b/toolchain/check/testdata/packages/fail_api_not_found.carbon index 17846b621ca02..18f0e68fc5ff6 100644 --- a/toolchain/check/testdata/packages/fail_api_not_found.carbon +++ b/toolchain/check/testdata/packages/fail_api_not_found.carbon @@ -10,7 +10,7 @@ // --- fail_no_api.impl.carbon -// CHECK:STDERR: fail_no_api.impl.carbon:[[@LINE+4]]:6: error: corresponding API for 'Foo' not found +// CHECK:STDERR: fail_no_api.impl.carbon:[[@LINE+4]]:6: error(LibraryApiNotFound): corresponding API for 'Foo' not found // CHECK:STDERR: impl package Foo; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ impl package Foo; // --- fail_no_api_lib.impl.carbon -// CHECK:STDERR: fail_no_api_lib.impl.carbon:[[@LINE+4]]:6: error: corresponding API for 'Foo//no_api_lib' not found +// CHECK:STDERR: fail_no_api_lib.impl.carbon:[[@LINE+4]]:6: error(LibraryApiNotFound): corresponding API for 'Foo//no_api_lib' not found // CHECK:STDERR: impl package Foo library "no_api_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -26,7 +26,7 @@ impl package Foo library "[[@TEST_NAME]]"; // --- fail_no_api_main_lib.impl.carbon -// CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+3]]:6: error: corresponding API for 'Main//no_api_main_lib' not found +// CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+3]]:6: error(LibraryApiNotFound): corresponding API for 'Main//no_api_main_lib' not found // CHECK:STDERR: impl library "no_api_main_lib"; // CHECK:STDERR: ^~~~~~~ impl library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index acf0b94636103..ac9732f83d203 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -24,12 +24,12 @@ var Foo: i32; package Example library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: var.carbon:4:5: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: var.carbon:4:5: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: var Foo: i32; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: fn.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: fn.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn Foo(); // CHECK:STDERR: ^~~~~~~~~ import library "fn"; diff --git a/toolchain/check/testdata/packages/fail_cycle.carbon b/toolchain/check/testdata/packages/fail_cycle.carbon index c67865a5ce01d..5741a361e2e5c 100644 --- a/toolchain/check/testdata/packages/fail_cycle.carbon +++ b/toolchain/check/testdata/packages/fail_cycle.carbon @@ -12,7 +12,7 @@ package A; -// CHECK:STDERR: fail_a.carbon:[[@LINE+4]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import +// CHECK:STDERR: fail_a.carbon:[[@LINE+4]]:1: error(ImportCycleDetected): import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ import B; package B; -// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import +// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:1: error(ImportCycleDetected): import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: import C; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -32,7 +32,7 @@ import C; package C; -// CHECK:STDERR: fail_c.carbon:[[@LINE+4]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import +// CHECK:STDERR: fail_c.carbon:[[@LINE+4]]:1: error(ImportCycleDetected): import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: import A; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -40,7 +40,7 @@ import A; // --- fail_c.impl.carbon -// CHECK:STDERR: fail_c.impl.carbon:[[@LINE+4]]:6: error: import cannot be used due to a cycle; cycle must be fixed to import +// CHECK:STDERR: fail_c.impl.carbon:[[@LINE+4]]:6: error(ImportCycleDetected): import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: impl package C; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -50,7 +50,7 @@ impl package C; package CycleChild; -// CHECK:STDERR: fail_cycle_child.carbon:[[@LINE+3]]:1: error: import cannot be used due to a cycle; cycle must be fixed to import +// CHECK:STDERR: fail_cycle_child.carbon:[[@LINE+3]]:1: error(ImportCycleDetected): import cannot be used due to a cycle; cycle must be fixed to import // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ import B; diff --git a/toolchain/check/testdata/packages/fail_duplicate_api.carbon b/toolchain/check/testdata/packages/fail_duplicate_api.carbon index 5f9029a3847a5..7ef74c06af424 100644 --- a/toolchain/check/testdata/packages/fail_duplicate_api.carbon +++ b/toolchain/check/testdata/packages/fail_duplicate_api.carbon @@ -7,7 +7,7 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_duplicate_api.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_duplicate_api.carbon -// CHECK:STDERR: fail_main2.carbon: error: `Main//default` previously provided by `main1.carbon` +// CHECK:STDERR: fail_main2.carbon: error(DuplicateMainApi): `Main//default` previously provided by `main1.carbon` // CHECK:STDERR: // --- main1.carbon @@ -20,7 +20,7 @@ library "lib"; // --- fail_main_lib2.carbon -// CHECK:STDERR: fail_main_lib2.carbon:[[@LINE+4]]:1: error: library's API previously provided by `main_lib1.carbon` +// CHECK:STDERR: fail_main_lib2.carbon:[[@LINE+4]]:1: error(DuplicateLibraryApi): library's API previously provided by `main_lib1.carbon` // CHECK:STDERR: library "lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -32,7 +32,7 @@ package Package; // --- fail_package2.carbon -// CHECK:STDERR: fail_package2.carbon:[[@LINE+4]]:1: error: library's API previously provided by `package1.carbon` +// CHECK:STDERR: fail_package2.carbon:[[@LINE+4]]:1: error(DuplicateLibraryApi): library's API previously provided by `package1.carbon` // CHECK:STDERR: package Package; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -44,7 +44,7 @@ package Package library "lib"; // --- fail_package_lib2.carbon -// CHECK:STDERR: fail_package_lib2.carbon:[[@LINE+3]]:1: error: library's API previously provided by `package_lib1.carbon` +// CHECK:STDERR: fail_package_lib2.carbon:[[@LINE+3]]:1: error(DuplicateLibraryApi): library's API previously provided by `package_lib1.carbon` // CHECK:STDERR: package Package library "lib"; // CHECK:STDERR: ^~~~~~~ package Package library "lib"; diff --git a/toolchain/check/testdata/packages/fail_extension.carbon b/toolchain/check/testdata/packages/fail_extension.carbon index a43ad91146fa6..37e7b851b1fe9 100644 --- a/toolchain/check/testdata/packages/fail_extension.carbon +++ b/toolchain/check/testdata/packages/fail_extension.carbon @@ -7,12 +7,12 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_extension.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_extension.carbon -// CHECK:STDERR: fail_main.incorrect: error: file extension of `.carbon` required for `api` +// CHECK:STDERR: fail_main.incorrect: error(IncorrectExtension): file extension of `.carbon` required for `api` // CHECK:STDERR: -// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error: `Main//default` previously provided by `fail_main.incorrect` +// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error(DuplicateMainApi): `Main//default` previously provided by `fail_main.incorrect` // CHECK:STDERR: -// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error: file extension of `.carbon` required for `api` -// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: note: file extension of `.impl.carbon` only allowed for `impl` +// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: error(IncorrectExtension): file extension of `.carbon` required for `api` +// CHECK:STDERR: fail_main_redundant_with_swapped_ext.impl.carbon: note(IncorrectExtensionImplNote): file extension of `.impl.carbon` only allowed for `impl` // CHECK:STDERR: // --- fail_main.incorrect @@ -21,7 +21,7 @@ // --- fail_main_lib.incorrect -// CHECK:STDERR: fail_main_lib.incorrect:[[@LINE+4]]:1: error: file extension of `.carbon` required for `api` +// CHECK:STDERR: fail_main_lib.incorrect:[[@LINE+4]]:1: error(IncorrectExtension): file extension of `.carbon` required for `api` // CHECK:STDERR: library "main_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -29,7 +29,7 @@ library "[[@TEST_NAME]]"; // --- fail_main_lib.impl.incorrect -// CHECK:STDERR: fail_main_lib.impl.incorrect:[[@LINE+4]]:6: error: file extension of `.impl.carbon` required for `impl` +// CHECK:STDERR: fail_main_lib.impl.incorrect:[[@LINE+4]]:6: error(IncorrectExtension): file extension of `.impl.carbon` required for `impl` // CHECK:STDERR: impl library "main_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -37,7 +37,7 @@ impl library "[[@TEST_NAME]]"; // --- fail_package.incorrect -// CHECK:STDERR: fail_package.incorrect:[[@LINE+4]]:1: error: file extension of `.carbon` required for `api` +// CHECK:STDERR: fail_package.incorrect:[[@LINE+4]]:1: error(IncorrectExtension): file extension of `.carbon` required for `api` // CHECK:STDERR: package Package; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -45,7 +45,7 @@ package Package; // --- fail_package_impl.incorrect -// CHECK:STDERR: fail_package_impl.incorrect:[[@LINE+4]]:6: error: file extension of `.impl.carbon` required for `impl` +// CHECK:STDERR: fail_package_impl.incorrect:[[@LINE+4]]:6: error(IncorrectExtension): file extension of `.impl.carbon` required for `impl` // CHECK:STDERR: impl package Package; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -53,7 +53,7 @@ impl package Package; // --- fail_package_lib.incorrect -// CHECK:STDERR: fail_package_lib.incorrect:[[@LINE+4]]:1: error: file extension of `.carbon` required for `api` +// CHECK:STDERR: fail_package_lib.incorrect:[[@LINE+4]]:1: error(IncorrectExtension): file extension of `.carbon` required for `api` // CHECK:STDERR: package Package library "package_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -61,7 +61,7 @@ package Package library "[[@TEST_NAME]]"; // --- fail_package_lib.impl.incorrect -// CHECK:STDERR: fail_package_lib.impl.incorrect:[[@LINE+4]]:6: error: file extension of `.impl.carbon` required for `impl` +// CHECK:STDERR: fail_package_lib.impl.incorrect:[[@LINE+4]]:6: error(IncorrectExtension): file extension of `.impl.carbon` required for `impl` // CHECK:STDERR: impl package Package library "package_lib"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -69,16 +69,16 @@ impl package Package library "[[@TEST_NAME]]"; // --- fail_swapped_ext.impl.carbon -// CHECK:STDERR: fail_swapped_ext.impl.carbon:[[@LINE+5]]:1: error: file extension of `.carbon` required for `api` +// CHECK:STDERR: fail_swapped_ext.impl.carbon:[[@LINE+5]]:1: error(IncorrectExtension): file extension of `.carbon` required for `api` // CHECK:STDERR: package SwappedExt; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_swapped_ext.impl.carbon: note: file extension of `.impl.carbon` only allowed for `impl` +// CHECK:STDERR: fail_swapped_ext.impl.carbon: note(IncorrectExtensionImplNote): file extension of `.impl.carbon` only allowed for `impl` // CHECK:STDERR: package SwappedExt; // --- fail_swapped_ext.carbon -// CHECK:STDERR: fail_swapped_ext.carbon:[[@LINE+3]]:6: error: file extension of `.impl.carbon` required for `impl` +// CHECK:STDERR: fail_swapped_ext.carbon:[[@LINE+3]]:6: error(IncorrectExtension): file extension of `.impl.carbon` required for `impl` // CHECK:STDERR: impl package SwappedExt; // CHECK:STDERR: ^~~~~~~ impl package SwappedExt; diff --git a/toolchain/check/testdata/packages/fail_import_default.carbon b/toolchain/check/testdata/packages/fail_import_default.carbon index 45a226c631f94..d7420ae919d07 100644 --- a/toolchain/check/testdata/packages/fail_import_default.carbon +++ b/toolchain/check/testdata/packages/fail_import_default.carbon @@ -12,7 +12,7 @@ package A; -// CHECK:STDERR: fail_default_api.carbon:[[@LINE+4]]:1: error: file cannot import itself +// CHECK:STDERR: fail_default_api.carbon:[[@LINE+4]]:1: error(ImportSelf): file cannot import itself // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -22,7 +22,7 @@ import library default; impl package A; -// CHECK:STDERR: fail_default.impl.carbon:[[@LINE+4]]:1: error: explicit import of `api` from `impl` file is redundant with implicit import +// CHECK:STDERR: fail_default.impl.carbon:[[@LINE+4]]:1: error(ExplicitImportApi): explicit import of `api` from `impl` file is redundant with implicit import // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -30,7 +30,7 @@ import library default; // --- fail_main_import_default.carbon -// CHECK:STDERR: fail_main_import_default.carbon:[[@LINE+4]]:1: error: explicit import of `api` from `impl` file is redundant with implicit import +// CHECK:STDERR: fail_main_import_default.carbon:[[@LINE+4]]:1: error(ExplicitImportApi): explicit import of `api` from `impl` file is redundant with implicit import // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -40,7 +40,7 @@ import library default; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_main_lib_import_default.carbon:[[@LINE+3]]:1: error: cannot import `Main//default` +// CHECK:STDERR: fail_main_lib_import_default.carbon:[[@LINE+3]]:1: error(ImportMainDefaultLibrary): cannot import `Main//default` // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ import library default; diff --git a/toolchain/check/testdata/packages/fail_import_invalid.carbon b/toolchain/check/testdata/packages/fail_import_invalid.carbon index 820205fd10d7a..9b86819145278 100644 --- a/toolchain/check/testdata/packages/fail_import_invalid.carbon +++ b/toolchain/check/testdata/packages/fail_import_invalid.carbon @@ -10,13 +10,13 @@ // --- fail_main.carbon -// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error: imports from the current package must omit the package name +// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error(ImportCurrentPackageByName): imports from the current package must omit the package name // CHECK:STDERR: import Main; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: import Main; -// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error: imports from the current package must omit the package name +// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error(ImportCurrentPackageByName): imports from the current package must omit the package name // CHECK:STDERR: import Main library "lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -26,13 +26,13 @@ import Main library "lib"; package NotMain; -// CHECK:STDERR: fail_not_main.carbon:[[@LINE+4]]:1: error: cannot import `Main` from other packages +// CHECK:STDERR: fail_not_main.carbon:[[@LINE+4]]:1: error(ImportMainPackage): cannot import `Main` from other packages // CHECK:STDERR: import Main; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: import Main; -// CHECK:STDERR: fail_not_main.carbon:[[@LINE+4]]:1: error: cannot import `Main` from other packages +// CHECK:STDERR: fail_not_main.carbon:[[@LINE+4]]:1: error(ImportMainPackage): cannot import `Main` from other packages // CHECK:STDERR: import Main library "lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ import Main library "lib"; package This; -// CHECK:STDERR: fail_this.carbon:[[@LINE+4]]:1: error: file cannot import itself +// CHECK:STDERR: fail_this.carbon:[[@LINE+4]]:1: error(ImportSelf): file cannot import itself // CHECK:STDERR: import This; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ import This; package This library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_this_lib.carbon:[[@LINE+4]]:1: error: file cannot import itself +// CHECK:STDERR: fail_this_lib.carbon:[[@LINE+4]]:1: error(ImportSelf): file cannot import itself // CHECK:STDERR: import library "this_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -66,7 +66,7 @@ package Implicit; impl package Implicit; -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:1: error: explicit import of `api` from `impl` file is redundant with implicit import +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:1: error(ExplicitImportApi): explicit import of `api` from `impl` file is redundant with implicit import // CHECK:STDERR: import Implicit; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -80,7 +80,7 @@ package Implicit library "[[@TEST_NAME]]"; impl package Implicit library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_implicit_lib.impl.carbon:[[@LINE+4]]:1: error: explicit import of `api` from `impl` file is redundant with implicit import +// CHECK:STDERR: fail_implicit_lib.impl.carbon:[[@LINE+4]]:1: error(ExplicitImportApi): explicit import of `api` from `impl` file is redundant with implicit import // CHECK:STDERR: import Implicit library "implicit_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -89,7 +89,7 @@ import Implicit library "implicit_lib"; // --- fail_not_found.carbon package NotFound; -// CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:1: error: imported API 'ImportNotFound' not found +// CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:1: error(ImportNotFound): imported API 'ImportNotFound' not found // CHECK:STDERR: import ImportNotFound; // CHECK:STDERR: ^~~~~~ import ImportNotFound; diff --git a/toolchain/check/testdata/packages/fail_import_repeat.carbon b/toolchain/check/testdata/packages/fail_import_repeat.carbon index f38ef2cc7bd3e..65ff44db01fa8 100644 --- a/toolchain/check/testdata/packages/fail_import_repeat.carbon +++ b/toolchain/check/testdata/packages/fail_import_repeat.carbon @@ -23,30 +23,30 @@ library "[[@TEST_NAME]]"; // --- fail_import.carbon import Api; -// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once +// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error(RepeatedImport): library imported more than once // CHECK:STDERR: import Api; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note: first import here +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note(FirstImported): first import here // CHECK:STDERR: import Api; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: import Api; import Api library "api_lib"; -// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once +// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error(RepeatedImport): library imported more than once // CHECK:STDERR: import Api library "api_lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note: first import here +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note(FirstImported): first import here // CHECK:STDERR: import Api library "api_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: import Api library "api_lib"; import library "main_lib"; -// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error: library imported more than once +// CHECK:STDERR: fail_import.carbon:[[@LINE+7]]:1: error(RepeatedImport): library imported more than once // CHECK:STDERR: import library "main_lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note: first import here +// CHECK:STDERR: fail_import.carbon:[[@LINE-4]]:1: note(FirstImported): first import here // CHECK:STDERR: import library "main_lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -57,10 +57,10 @@ import library "main_lib"; package Api library "[[@TEST_NAME]]"; import library default; -// CHECK:STDERR: fail_default_import.carbon:[[@LINE+6]]:1: error: library imported more than once +// CHECK:STDERR: fail_default_import.carbon:[[@LINE+6]]:1: error(RepeatedImport): library imported more than once // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_default_import.carbon:[[@LINE-4]]:1: note: first import here +// CHECK:STDERR: fail_default_import.carbon:[[@LINE-4]]:1: note(FirstImported): first import here // CHECK:STDERR: import library default; // CHECK:STDERR: ^~~~~~ import library default; diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index ffe85110e0400..2bff2d402e9c3 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -12,22 +12,22 @@ package Implicit; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:12: error: name `x` not found +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:12: error(NameNotFound): name `x` not found // CHECK:STDERR: var a_ref: x; // CHECK:STDERR: ^ // CHECK:STDERR: var a_ref: x; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:18: error: name `x` not found +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:18: error(NameNotFound): name `x` not found // CHECK:STDERR: var b_ref: {.a = x}; // CHECK:STDERR: ^ // CHECK:STDERR: var b_ref: {.a = x}; -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:13: error: name `x` not found +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+4]]:13: error(NameNotFound): name `x` not found // CHECK:STDERR: var c_ref: (x,); // CHECK:STDERR: ^ // CHECK:STDERR: var c_ref: (x,); -// CHECK:STDERR: fail_implicit.carbon:[[@LINE+3]]:12: error: name `x` not found +// CHECK:STDERR: fail_implicit.carbon:[[@LINE+3]]:12: error(NameNotFound): name `x` not found // CHECK:STDERR: var d_ref: x*; // CHECK:STDERR: ^ var d_ref: x*; diff --git a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon index 788a39a8b1469..ba54acad29314 100644 --- a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon +++ b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon @@ -10,7 +10,7 @@ // --- fail_implicit.impl.carbon -// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:6: error: corresponding API for 'Implicit' not found +// CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+3]]:6: error(LibraryApiNotFound): corresponding API for 'Implicit' not found // CHECK:STDERR: impl package Implicit; // CHECK:STDERR: ^~~~~~~ impl package Implicit; diff --git a/toolchain/check/testdata/packages/fail_package_main.carbon b/toolchain/check/testdata/packages/fail_package_main.carbon index e6522df8f56f3..3da0014cc75e5 100644 --- a/toolchain/check/testdata/packages/fail_package_main.carbon +++ b/toolchain/check/testdata/packages/fail_package_main.carbon @@ -10,7 +10,7 @@ // --- fail_main.carbon -// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error: `Main//default` must omit `package` declaration +// CHECK:STDERR: fail_main.carbon:[[@LINE+4]]:1: error(ExplicitMainPackage): `Main//default` must omit `package` declaration // CHECK:STDERR: package Main; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ package Main; // --- fail_main_impl.carbon -// CHECK:STDERR: fail_main_impl.carbon:[[@LINE+4]]:6: error: `Main//default` must omit `package` declaration +// CHECK:STDERR: fail_main_impl.carbon:[[@LINE+4]]:6: error(ExplicitMainPackage): `Main//default` must omit `package` declaration // CHECK:STDERR: impl package Main; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -27,7 +27,7 @@ impl package Main; // --- fail_raw_main.carbon // `Main` isn't a keyword, so this fails the same way. -// CHECK:STDERR: fail_raw_main.carbon:[[@LINE+4]]:1: error: `Main//default` must omit `package` declaration +// CHECK:STDERR: fail_raw_main.carbon:[[@LINE+4]]:1: error(ExplicitMainPackage): `Main//default` must omit `package` declaration // CHECK:STDERR: package r#Main; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -35,7 +35,7 @@ package r#Main; // --- fail_main_lib.carbon -// CHECK:STDERR: fail_main_lib.carbon:[[@LINE+3]]:1: error: use `library` declaration in `Main` package libraries +// CHECK:STDERR: fail_main_lib.carbon:[[@LINE+3]]:1: error(ExplicitMainLibrary): use `library` declaration in `Main` package libraries // CHECK:STDERR: package Main library "main_lib"; // CHECK:STDERR: ^~~~~~~ package Main library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index eee187d8e69a9..99c34890026ff 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -153,18 +153,18 @@ import Other library "conflict"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: base.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: base.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: conflict.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: conflict.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ import Other library "export_import"; import Other library "conflict"; -// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:11: note: in name lookup for `C` +// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:11: note(InNameLookup): in name lookup for `C` // CHECK:STDERR: alias C = Other.C; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -174,19 +174,19 @@ alias C = Other.C; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+9]]:1: in import -// CHECK:STDERR: conflict.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+9]]:1(InImport): in import +// CHECK:STDERR: conflict.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn C() {} // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: export_name.carbon:4:1: in import -// CHECK:STDERR: base.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: export_name.carbon:4:1(InImport): in import +// CHECK:STDERR: base.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ import Other library "export_name"; import Other library "conflict"; -// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+3]]:11: note: in name lookup for `C` +// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+3]]:11: note(InNameLookup): in name lookup for `C` // CHECK:STDERR: alias C = Other.C; // CHECK:STDERR: ^~~~~~~ alias C = Other.C; diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index ed2abc1feac13..180bc097138b4 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -70,19 +70,19 @@ fn Run() { library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: other_fn_extern.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: other_fn_extern.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: extern fn F(); // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: other_fn.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: other_fn.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ import Other library "other_fn"; import Other library "other_fn_extern"; fn Run() { - // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:3: note: in name lookup for `F` + // CHECK:STDERR: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:3: note(InNameLookup): in name lookup for `F` // CHECK:STDERR: Other.F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -100,19 +100,19 @@ import Other library "other_fn_conflict"; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+8]]:1: in import -// CHECK:STDERR: other_fn_conflict.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+8]]:1(InImport): in import +// CHECK:STDERR: other_fn_conflict.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: fn F(x: ()) {} // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:1: in import -// CHECK:STDERR: other_fn.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:1(InImport): in import +// CHECK:STDERR: other_fn.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ import Other library "other_fn"; import Other library "other_fn_conflict"; fn Run() { - // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:3: note: in name lookup for `F` + // CHECK:STDERR: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:3: note(InNameLookup): in name lookup for `F` // CHECK:STDERR: Other.F(); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -124,21 +124,21 @@ fn Run() { library "[[@TEST_NAME]]"; import library "main_other_ns"; -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+8]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-4]]:1: in import -// CHECK:STDERR: main_other_ns.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-4]]:1(InImport): in import +// CHECK:STDERR: main_other_ns.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ // CHECK:STDERR: import Other library "other_fn"; -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+8]]:1: error: redeclaration of `fn F` is redundant +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+8]]:1: error(RedeclRedundant): redeclaration of `fn F` is redundant // CHECK:STDERR: fn Other.F() {} // CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: other_fn.carbon:4:1: note: previously declared here +// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: other_fn.carbon:4:1: note(RedeclPrevDecl): previously declared here // CHECK:STDERR: fn F() {} // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: @@ -150,10 +150,10 @@ library "[[@TEST_NAME]]"; import Other library "other_fn"; -// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE+7]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE+7]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: namespace Other; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE-5]]:1: note: name is previously declared here +// CHECK:STDERR: fail_main_reopen_other.carbon:[[@LINE-5]]:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -168,10 +168,10 @@ library "[[@TEST_NAME]]"; import Other library "other_fn"; -// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE+7]]:11: error: imported packages cannot be used for declarations +// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE+7]]:11: error(QualifiedDeclOutsidePackage): imported packages cannot be used for declarations // CHECK:STDERR: namespace Other.Nested; // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE-5]]:1: note: package imported here +// CHECK:STDERR: fail_main_reopen_other_nested.carbon:[[@LINE-5]]:1: note(QualifiedDeclOutsidePackageSource): package imported here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -186,10 +186,10 @@ library "[[@TEST_NAME]]"; import Other library "other_fn"; -// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE+7]]:4: error: imported packages cannot be used for declarations +// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE+7]]:4: error(QualifiedDeclOutsidePackage): imported packages cannot be used for declarations // CHECK:STDERR: fn Other.G() {} // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE-5]]:1: note: package imported here +// CHECK:STDERR: fail_main_add_to_other.carbon:[[@LINE-5]]:1: note(QualifiedDeclOutsidePackageSource): package imported here // CHECK:STDERR: import Other library "other_fn"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -201,7 +201,7 @@ library "[[@TEST_NAME]]"; import Other library "other_fn_use"; -// CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+3]]:13: error: name `F` not found +// CHECK:STDERR: fail_use_other_fn_use.carbon:[[@LINE+3]]:13: error(NameNotFound): name `F` not found // CHECK:STDERR: fn UseF() { Other.F(); } // CHECK:STDERR: ^~~~~~~ fn UseF() { Other.F(); } diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/no_prelude/export_import.carbon index 403ddcf664591..a44fd40a33f3f 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_import.carbon @@ -72,7 +72,7 @@ var c: C = {.x = ()}; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_export_in_impl.impl.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files +// CHECK:STDERR: fail_export_in_impl.impl.carbon:[[@LINE+4]]:1: error(ExportFromImpl): `export` is only allowed in API files // CHECK:STDERR: export import library "base"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -144,7 +144,7 @@ library "[[@TEST_NAME]]"; import library "non_export"; -// CHECK:STDERR: fail_use_non_export.carbon:[[@LINE+3]]:15: error: name `C` not found +// CHECK:STDERR: fail_use_non_export.carbon:[[@LINE+3]]:15: error(NameNotFound): name `C` not found // CHECK:STDERR: alias Local = C; // CHECK:STDERR: ^ alias Local = C; diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon index 81b8ae1bcd7f2..8cf9577498e36 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon @@ -88,7 +88,7 @@ library "[[@TEST_NAME]]"; import library "export_import_then_name"; import library "export_name_then_import"; -// CHECK:STDERR: fail_nonexport_use_both.carbon:[[@LINE+3]]:8: error: name `D` not found +// CHECK:STDERR: fail_nonexport_use_both.carbon:[[@LINE+3]]:8: error(NameNotFound): name `D` not found // CHECK:STDERR: var d: D = {.y = ()}; // CHECK:STDERR: ^ var d: D = {.y = ()}; diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index 8ed381038f03e..abefdfef72cf7 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -87,11 +87,11 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_export_ns.carbon:[[@LINE+8]]:1: error: only imported entities are valid for `export` +// CHECK:STDERR: fail_export_ns.carbon:[[@LINE+8]]:1: error(ExportNotImportedEntity): only imported entities are valid for `export` // CHECK:STDERR: export NS; // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_export_ns.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: base.carbon:8:1: note: name is declared here +// CHECK:STDERR: fail_export_ns.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: base.carbon:8:1: note(ExportNotImportedEntitySource): name is declared here // CHECK:STDERR: namespace NS; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -103,10 +103,10 @@ library "[[@TEST_NAME]]"; class Local {} -// CHECK:STDERR: fail_export_decl.carbon:[[@LINE+7]]:1: error: only imported entities are valid for `export` +// CHECK:STDERR: fail_export_decl.carbon:[[@LINE+7]]:1: error(ExportNotImportedEntity): only imported entities are valid for `export` // CHECK:STDERR: export Local; // CHECK:STDERR: ^~~~~~~~~~~~~ -// CHECK:STDERR: fail_export_decl.carbon:[[@LINE-5]]:1: note: name is declared here +// CHECK:STDERR: fail_export_decl.carbon:[[@LINE-5]]:1: note(ExportNotImportedEntitySource): name is declared here // CHECK:STDERR: class Local {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -118,11 +118,11 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_export_member.carbon:[[@LINE+8]]:8: error: name qualifiers are only allowed for entities that provide a scope +// CHECK:STDERR: fail_export_member.carbon:[[@LINE+8]]:8: error(QualifiedNameInNonScope): name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: export C.x; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_export_member.carbon:[[@LINE-5]]:1: in import -// CHECK:STDERR: base.carbon:4:1: note: referenced non-scope entity declared here +// CHECK:STDERR: fail_export_member.carbon:[[@LINE-5]]:1(InImport): in import +// CHECK:STDERR: base.carbon:4:1: note(QualifiedNameNonScopeEntity): referenced non-scope entity declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -154,12 +154,12 @@ library "[[@TEST_NAME]]"; import library "not_reexporting"; -// CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:15: error: name `C` not found +// CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:15: error(NameNotFound): name `C` not found // CHECK:STDERR: alias Local = C; // CHECK:STDERR: ^ // CHECK:STDERR: alias Local = C; -// CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:17: error: name `NS` not found +// CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:17: error(NameNotFound): name `NS` not found // CHECK:STDERR: alias NSLocal = NS.NSC; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -172,10 +172,10 @@ library "[[@TEST_NAME]]"; import library "base"; export C; -// CHECK:STDERR: repeat_export.carbon:[[@LINE+7]]:1: warning: `export` matches previous `export` +// CHECK:STDERR: repeat_export.carbon:[[@LINE+7]]:1: warning(ExportRedundant): `export` matches previous `export` // CHECK:STDERR: export C; // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: repeat_export.carbon:[[@LINE-4]]:1: note: previous `export` here +// CHECK:STDERR: repeat_export.carbon:[[@LINE-4]]:1: note(ExportPrevious): previous `export` here // CHECK:STDERR: export C; // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -195,7 +195,7 @@ library "[[@TEST_NAME]]"; import library "base"; -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `private` not allowed on `export` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error(ModifierNotAllowedOnDeclaration): `private` not allowed on `export` declaration // CHECK:STDERR: private export C; // CHECK:STDERR: ^~~~~~~ private export C; diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon index aa4361768fae6..5c8ce3bfa9cb7 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon @@ -24,11 +24,11 @@ import library "a"; // TODO: This diagnostic doesn't clearly explain the problem. We should instead // say something like: Only namespace-scope names can be exported. -// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:8: error: name qualifiers are only allowed for entities that provide a scope +// CHECK:STDERR: fail_b.carbon:[[@LINE+7]]:8: error(QualifiedNameInNonScope): name qualifiers are only allowed for entities that provide a scope // CHECK:STDERR: export C.n; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_b.carbon:[[@LINE-7]]:1: in import -// CHECK:STDERR: a.carbon:4:1: note: referenced non-scope entity declared here +// CHECK:STDERR: fail_b.carbon:[[@LINE-7]]:1(InImport): in import +// CHECK:STDERR: a.carbon:4:1: note(QualifiedNameNonScopeEntity): referenced non-scope entity declared here // CHECK:STDERR: class C { // CHECK:STDERR: ^~~~~~~~~ export C.n; diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon index 513222e0bfbcb..70f6c15c11230 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon @@ -23,7 +23,7 @@ import library "a"; export C1; -// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:10: error: `export` declaration cannot have parameters +// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:10: error(UnexpectedDeclNameParams): `export` declaration cannot have parameters // CHECK:STDERR: export C2(T:! type); // CHECK:STDERR: ^~~~~~~~~~ export C2(T:! type); diff --git a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon index c31fbad70fac9..2825d6e9037f2 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon @@ -10,7 +10,7 @@ // --- fail_export_package.carbon -// CHECK:STDERR: fail_export_package.carbon:[[@LINE+4]]:1: error: `export` not allowed on `package` declaration +// CHECK:STDERR: fail_export_package.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `export` not allowed on `package` declaration // CHECK:STDERR: export package ExportPackage; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ export package ExportPackage; // --- fail_extend_package.carbon -// CHECK:STDERR: fail_extend_package.carbon:[[@LINE+4]]:1: error: `extend` not allowed on `package` declaration +// CHECK:STDERR: fail_extend_package.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `extend` not allowed on `package` declaration // CHECK:STDERR: extend package ExtendPackage; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -26,7 +26,7 @@ extend package ExtendPackage; // --- fail_virtual_package.carbon -// CHECK:STDERR: fail_virtual_package.carbon:[[@LINE+4]]:1: error: `virtual` not allowed on `package` declaration +// CHECK:STDERR: fail_virtual_package.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `virtual` not allowed on `package` declaration // CHECK:STDERR: virtual package VirtualPackage; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -34,7 +34,7 @@ virtual package VirtualPackage; // --- fail_private_package.carbon -// CHECK:STDERR: fail_private_package.carbon:[[@LINE+4]]:1: error: `private` not allowed on `package` declaration +// CHECK:STDERR: fail_private_package.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `private` not allowed on `package` declaration // CHECK:STDERR: private package PrivatePackage; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -42,7 +42,7 @@ private package PrivatePackage; // --- fail_export_library.carbon -// CHECK:STDERR: fail_export_library.carbon:[[@LINE+4]]:1: error: `export` not allowed on `library` declaration +// CHECK:STDERR: fail_export_library.carbon:[[@LINE+4]]:1: error(ModifierNotAllowedOnDeclaration): `export` not allowed on `library` declaration // CHECK:STDERR: export library "export_library"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -50,51 +50,51 @@ export library "export_library"; // --- fail_import_modifiers.carbon -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error: `impl` not allowed on `import` declaration +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error(ModifierNotAllowedOnDeclaration): `impl` not allowed on `import` declaration // CHECK:STDERR: impl import ImplImport; // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:6: error: imported API 'ImplImport' not found +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:6: error(ImportNotFound): imported API 'ImplImport' not found // CHECK:STDERR: impl import ImplImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: impl import ImplImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error: `extend` not allowed on `import` declaration +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error(ModifierNotAllowedOnDeclaration): `extend` not allowed on `import` declaration // CHECK:STDERR: extend import ExtendImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:8: error: imported API 'ExtendImport' not found +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:8: error(ImportNotFound): imported API 'ExtendImport' not found // CHECK:STDERR: extend import ExtendImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: extend import ExtendImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error: `virtual` not allowed on `import` declaration +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error(ModifierNotAllowedOnDeclaration): `virtual` not allowed on `import` declaration // CHECK:STDERR: virtual import VirtualImport; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:9: error: imported API 'VirtualImport' not found +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:9: error(ImportNotFound): imported API 'VirtualImport' not found // CHECK:STDERR: virtual import VirtualImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: virtual import VirtualImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error: `base` not allowed on `import` declaration +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+8]]:1: error(ModifierNotAllowedOnDeclaration): `base` not allowed on `import` declaration // CHECK:STDERR: base import BaseImport; // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:6: error: imported API 'BaseImport' not found +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+4]]:6: error(ImportNotFound): imported API 'BaseImport' not found // CHECK:STDERR: base import BaseImport; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: base import BaseImport; -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+7]]:1: error: `private` not allowed on `import` declaration +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+7]]:1: error(ModifierNotAllowedOnDeclaration): `private` not allowed on `import` declaration // CHECK:STDERR: private import PrivateImport; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+3]]:9: error: imported API 'PrivateImport' not found +// CHECK:STDERR: fail_import_modifiers.carbon:[[@LINE+3]]:9: error(ImportNotFound): imported API 'PrivateImport' not found // CHECK:STDERR: private import PrivateImport; // CHECK:STDERR: ^~~~~~ private import PrivateImport; diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index cdecf540391d1..e7986b54fd5aa 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -131,12 +131,12 @@ import Other library "o1"; // --- fail_import_conflict.impl.carbon -// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+9]]:6: in import -// CHECK:STDERR: import_conflict.carbon:4:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+9]]:6(InImport): in import +// CHECK:STDERR: import_conflict.carbon:4:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+5]]:6: in import -// CHECK:STDERR: local_other.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_import_conflict.impl.carbon:[[@LINE+5]]:6(InImport): in import +// CHECK:STDERR: local_other.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: @@ -154,12 +154,12 @@ import library "local_other"; impl library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+8]]:1: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+8]]:1: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: import Other library "o1"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: import_conflict_reverse.carbon:4:1: in import -// CHECK:STDERR: local_other.carbon:4:1: note: name is previously declared here +// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: import_conflict_reverse.carbon:4:1(InImport): in import +// CHECK:STDERR: local_other.carbon:4:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: class Other {} // CHECK:STDERR: ^~~~~~~~~~~~~ import Other library "o1"; diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon index b17d8f12615d3..7bf92b984d08a 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon @@ -12,7 +12,7 @@ library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_missing_prelude.carbon:[[@LINE+4]]:8: error: package `Core` implicitly referenced here, but not found +// CHECK:STDERR: fail_missing_prelude.carbon:[[@LINE+4]]:8: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -28,7 +28,7 @@ library "[[@TEST_NAME]]"; import Core library "prelude_empty"; -// CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: error: name `Core.Int32` implicitly referenced here, but not found +// CHECK:STDERR: fail_missing_prelude_member.carbon:[[@LINE+4]]:8: error(CoreNameNotFound): name `Core.Int32` implicitly referenced here, but not found // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -80,7 +80,7 @@ class Core { fn Int32() -> {} { return {}; } } -// CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+3]]:13: error: package `Core` implicitly referenced here, but not found +// CHECK:STDERR: fail_prelude_as_class.carbon:[[@LINE+3]]:13: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: var n: {} = i32; // CHECK:STDERR: ^~~ var n: {} = i32; diff --git a/toolchain/check/testdata/pointer/fail_address_of_error.carbon b/toolchain/check/testdata/pointer/fail_address_of_error.carbon index d1bb8ef2eeba1..ad85a83cd19a8 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_error.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_error.carbon @@ -9,16 +9,16 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_address_of_error.carbon fn Test() { - // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+4]]:4: error: name `undeclared` not found + // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+4]]:4: error(NameNotFound): name `undeclared` not found // CHECK:STDERR: &undeclared; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: &undeclared; - // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+7]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+7]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &(&undeclared); // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+3]]:6: error: name `undeclared` not found + // CHECK:STDERR: fail_address_of_error.carbon:[[@LINE+3]]:6: error(NameNotFound): name `undeclared` not found // CHECK:STDERR: &(&undeclared); // CHECK:STDERR: ^~~~~~~~~~ &(&undeclared); diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index bd7dbf0607f46..0f6fc71ab30bd 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -13,32 +13,32 @@ fn G() -> i32; fn H() -> {.a: i32}; fn AddressOfLiteral() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &0; // CHECK:STDERR: ^ // CHECK:STDERR: &0; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &true; // CHECK:STDERR: ^ // CHECK:STDERR: &true; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &1.0; // CHECK:STDERR: ^ // CHECK:STDERR: &1.0; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &"Hello"; // CHECK:STDERR: ^ // CHECK:STDERR: &"Hello"; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &(1, 2); // CHECK:STDERR: ^ // CHECK:STDERR: &(1, 2); - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &{.a = 5}; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -46,17 +46,17 @@ fn AddressOfLiteral() { } fn AddressOfOperator() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &(true and false); // CHECK:STDERR: ^ // CHECK:STDERR: &(true and false); - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of a temporary object + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfEphemeralRef): cannot take the address of a temporary object // CHECK:STDERR: &H().a; // CHECK:STDERR: ^ // CHECK:STDERR: &H().a; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &(not true); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -64,7 +64,7 @@ fn AddressOfOperator() { } fn AddressOfCall() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &G(); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -72,12 +72,12 @@ fn AddressOfCall() { } fn AddressOfType() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &i32; // CHECK:STDERR: ^ // CHECK:STDERR: &i32; - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &(const i32*); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -85,7 +85,7 @@ fn AddressOfType() { } fn AddressOfTupleElementValue() { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+4]]:3: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: &((1, 2).0); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -93,7 +93,7 @@ fn AddressOfTupleElementValue() { } fn AddressOfParam(param: i32) { - // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:26: error: cannot take the address of non-reference expression + // CHECK:STDERR: fail_address_of_value.carbon:[[@LINE+3]]:26: error(AddrOfNonRef): cannot take the address of non-reference expression // CHECK:STDERR: var param_addr: i32* = ¶m; // CHECK:STDERR: ^ var param_addr: i32* = ¶m; diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index aaa15244ebf66..70c1787c8b558 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -8,12 +8,12 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_error.carbon -// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+4]]:15: error: name `undeclared` not found +// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+4]]:15: error(NameNotFound): name `undeclared` not found // CHECK:STDERR: let n: i32 = *undeclared; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: let n: i32 = *undeclared; -// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+3]]:15: error: name `undeclared` not found +// CHECK:STDERR: fail_deref_error.carbon:[[@LINE+3]]:15: error(NameNotFound): name `undeclared` not found // CHECK:STDERR: let n2: i32 = undeclared->foo; // CHECK:STDERR: ^~~~~~~~~~ let n2: i32 = undeclared->foo; diff --git a/toolchain/check/testdata/pointer/fail_deref_function.carbon b/toolchain/check/testdata/pointer/fail_deref_function.carbon index 0f9e14d8d0788..dbeba356d24f8 100644 --- a/toolchain/check/testdata/pointer/fail_deref_function.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_function.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_function.carbon fn A() { - // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+4]]:4: error: expression cannot be used as a value + // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+4]]:4: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: *A; // CHECK:STDERR: ^ // CHECK:STDERR: *A; - // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value + // CHECK:STDERR: fail_deref_function.carbon:[[@LINE+3]]:3: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: A->foo; // CHECK:STDERR: ^ A->foo; diff --git a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon index 88453c1439b11..e215bfb64db66 100644 --- a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon @@ -11,12 +11,12 @@ namespace A; fn F() { - // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+4]]:4: error: expression cannot be used as a value + // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+4]]:4: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: *A; // CHECK:STDERR: ^ // CHECK:STDERR: *A; - // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value + // CHECK:STDERR: fail_deref_namespace.carbon:[[@LINE+3]]:3: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: A->foo; // CHECK:STDERR: ^ A->foo; diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index 75341b7bc8733..79a60da9c8a4e 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -9,32 +9,32 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon fn Deref(n: i32) { - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error: cannot dereference operand of non-pointer type `i32` + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error(DerefOfNonPointer): cannot dereference operand of non-pointer type `i32` // CHECK:STDERR: *n; // CHECK:STDERR: ^ // CHECK:STDERR: *n; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:4: error: cannot apply `->` operator to non-pointer type `i32` + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:4: error(ArrowOperatorOfNonPointer): cannot apply `->` operator to non-pointer type `i32` // CHECK:STDERR: n->foo; // CHECK:STDERR: ^~ // CHECK:STDERR: n->foo; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error: cannot dereference operand of non-pointer type `()` + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error(DerefOfNonPointer): cannot dereference operand of non-pointer type `()` // CHECK:STDERR: *(); // CHECK:STDERR: ^ // CHECK:STDERR: *(); - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:5: error: cannot apply `->` operator to non-pointer type `()` + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:5: error(ArrowOperatorOfNonPointer): cannot apply `->` operator to non-pointer type `()` // CHECK:STDERR: ()->foo; // CHECK:STDERR: ^~ // CHECK:STDERR: ()->foo; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error: cannot dereference operand of non-pointer type `{}` + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+4]]:3: error(DerefOfNonPointer): cannot dereference operand of non-pointer type `{}` // CHECK:STDERR: *{}; // CHECK:STDERR: ^ // CHECK:STDERR: *{}; - // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+3]]:5: error: cannot apply `->` operator to non-pointer type `{}` + // CHECK:STDERR: fail_deref_not_pointer.carbon:[[@LINE+3]]:5: error(ArrowOperatorOfNonPointer): cannot apply `->` operator to non-pointer type `{}` // CHECK:STDERR: {}->foo; // CHECK:STDERR: ^~ {}->foo; diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 07a8f33291281..44b4da2faec44 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -8,15 +8,15 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_deref_type.carbon -// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+7]]:8: error: cannot dereference operand of non-pointer type `type` +// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+7]]:8: error(DerefOfNonPointer): cannot dereference operand of non-pointer type `type` // CHECK:STDERR: var p: *i32; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+4]]:8: note: to form a pointer type, write the `*` after the pointee type +// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+4]]:8: note(DerefOfType): to form a pointer type, write the `*` after the pointee type // CHECK:STDERR: var p: *i32; // CHECK:STDERR: ^ // CHECK:STDERR: var p: *i32; -// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+3]]:12: error: cannot apply `->` operator to non-pointer type `type` +// CHECK:STDERR: fail_deref_type.carbon:[[@LINE+3]]:12: error(ArrowOperatorOfNonPointer): cannot apply `->` operator to non-pointer type `type` // CHECK:STDERR: var p2: i32->foo; // CHECK:STDERR: ^~ var p2: i32->foo; diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index 8be1d30de6518..cdc0a314a6e22 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/pointer/fail_type_mismatch.carbon fn ConstMismatch(p: const {}*) -> const ({}*) { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `const {}*` to `const ({}*)` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `const {}*` to `const ({}*)` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `const {}*` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note(MissingImplInMemberAccessNote): type `const {}*` does not implement interface `ImplicitAs` // CHECK:STDERR: return p; // CHECK:STDERR: ^~~~~~~~~ return p; diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index 0753bfd07671f..9135087cf53e1 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -11,7 +11,7 @@ // TODO: Some variant of this should work, once compile-time function calls are // supported. fn ReturnType() -> type { return i32; } -// CHECK:STDERR: fail_call_in_type.carbon:[[@LINE+3]]:13: error: cannot evaluate type expression +// CHECK:STDERR: fail_call_in_type.carbon:[[@LINE+3]]:13: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: fn Six() -> ReturnType() { return 6; } // CHECK:STDERR: ^~~~~~~~~~~~ fn Six() -> ReturnType() { return 6; } diff --git a/toolchain/check/testdata/return/fail_error_in_type.carbon b/toolchain/check/testdata/return/fail_error_in_type.carbon index 656fe26a79ec9..ed8db591f0dc2 100644 --- a/toolchain/check/testdata/return/fail_error_in_type.carbon +++ b/toolchain/check/testdata/return/fail_error_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_error_in_type.carbon -// CHECK:STDERR: fail_error_in_type.carbon:[[@LINE+3]]:13: error: name `x` not found +// CHECK:STDERR: fail_error_in_type.carbon:[[@LINE+3]]:13: error(NameNotFound): name `x` not found // CHECK:STDERR: fn Six() -> x; // CHECK:STDERR: ^ fn Six() -> x; diff --git a/toolchain/check/testdata/return/fail_let_in_type.carbon b/toolchain/check/testdata/return/fail_let_in_type.carbon index 4c880a55e27c5..7da27836e95cb 100644 --- a/toolchain/check/testdata/return/fail_let_in_type.carbon +++ b/toolchain/check/testdata/return/fail_let_in_type.carbon @@ -9,30 +9,30 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_let_in_type.carbon let x: type = i32; -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:13: error: cannot evaluate type expression +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:13: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: fn Six() -> x { return 6; } // CHECK:STDERR: ^ // CHECK:STDERR: fn Six() -> x { return 6; } // TODO: This should probably work. -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:5: error: semantics TODO: ``let` compile time binding outside function or interface` +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:5: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let y:! type = i32; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: let y:! type = i32; -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:19: error: cannot evaluate type expression +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+4]]:19: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: fn HalfDozen() -> y { return 6; } // CHECK:STDERR: ^ // CHECK:STDERR: fn HalfDozen() -> y { return 6; } // TODO: This should work. -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+7]]:5: error: semantics TODO: `HandleTemplate` +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+7]]:5: error(SemanticsTodo): semantics TODO: `HandleTemplate` // CHECK:STDERR: let template z:! type = i32; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+3]]:14: error: semantics TODO: ``let` compile time binding outside function or interface` +// CHECK:STDERR: fail_let_in_type.carbon:[[@LINE+3]]:14: error(SemanticsTodo): semantics TODO: ``let` compile time binding outside function or interface` // CHECK:STDERR: let template z:! type = i32; // CHECK:STDERR: ^~~~~~~~ let template z:! type = i32; diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index 3199a6936aa1e..644d43cc121ba 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_missing_return.carbon fn Main() -> i32 { -// CHECK:STDERR: fail_missing_return.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type +// CHECK:STDERR: fail_missing_return.carbon:[[@LINE+3]]:1: error(MissingReturnStatement): missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon index 7a5be82005014..2d0c10112dbe5 100644 --- a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon +++ b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon fn F() -> () { -// CHECK:STDERR: fail_missing_return_empty_tuple.carbon:[[@LINE+3]]:1: error: missing `return` at end of function with declared return type +// CHECK:STDERR: fail_missing_return_empty_tuple.carbon:[[@LINE+3]]:1: error(MissingReturnStatement): missing `return` at end of function with declared return type // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon index de03803c98c6f..3af7e8eb86809 100644 --- a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon fn Procedure() -> i32 { - // CHECK:STDERR: fail_return_var_no_returned_var.carbon:[[@LINE+3]]:3: error: `return var;` with no `returned var` in scope + // CHECK:STDERR: fail_return_var_no_returned_var.carbon:[[@LINE+3]]:3: error(ReturnVarWithNoReturnedVar): `return var;` with no `returned var` in scope // CHECK:STDERR: return var; // CHECK:STDERR: ^~~~~~~~~~~ return var; diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index 0e116e905b170..d76421c74025c 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -10,10 +10,10 @@ fn F() -> i32 { returned var v: i32 = 0; - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+7]]:3: error: can only `return var;` in the scope of a `returned var` + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+7]]:3: error(ReturnExprWithReturnedVar): can only `return var;` in the scope of a `returned var` // CHECK:STDERR: return 1; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: note: `returned var` was declared here + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: note(ReturnedVarHere): `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -23,10 +23,10 @@ fn F() -> i32 { class C { var a: i32; var b: i32; } fn G() -> C { returned var c: C = {.a = 1, .b = 2}; - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+6]]:3: error: can only `return var;` in the scope of a `returned var` + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE+6]]:3: error(ReturnExprWithReturnedVar): can only `return var;` in the scope of a `returned var` // CHECK:STDERR: return c; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: note: `returned var` was declared here + // CHECK:STDERR: fail_return_with_returned_var.carbon:[[@LINE-4]]:16: note(ReturnedVarHere): `returned var` was declared here // CHECK:STDERR: returned var c: C = {.a = 1, .b = 2}; // CHECK:STDERR: ^ return c; diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index b77b0a969ac68..31dcf95a5b440 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon fn Procedure() { - // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE+6]]:3: error: cannot declare a `returned var` in this function + // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE+6]]:3: error(ReturnedVarWithNoReturnType): cannot declare a `returned var` in this function // CHECK:STDERR: returned var v: () = (); // CHECK:STDERR: ^~~~~~~~ - // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE-4]]:1: note: there was no return type provided + // CHECK:STDERR: fail_returned_var_no_return_type.carbon:[[@LINE-4]]:1: note(ReturnTypeOmittedNote): there was no return type provided // CHECK:STDERR: fn Procedure() { // CHECK:STDERR: ^~~~~~~~~~~~~~~~ returned var v: () = (); diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 14fc5d82ea020..b869db39ac044 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -11,10 +11,10 @@ fn SameScope() -> i32 { if (true) { returned var v: i32 = 0; - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:18: error: cannot declare a `returned var` in the scope of another `returned var` + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+7]]:18: error(ReturnedVarShadowed): cannot declare a `returned var` in the scope of another `returned var` // CHECK:STDERR: returned var w: i32 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-4]]:18: note: `returned var` was declared here + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-4]]:18: note(ReturnedVarHere): `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -27,10 +27,10 @@ fn DifferentScopes() -> i32 { if (true) { returned var v: i32 = 0; if (true) { - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+6]]:20: error: cannot declare a `returned var` in the scope of another `returned var` + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE+6]]:20: error(ReturnedVarShadowed): cannot declare a `returned var` in the scope of another `returned var` // CHECK:STDERR: returned var w: i32 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-5]]:18: note: `returned var` was declared here + // CHECK:STDERR: fail_returned_var_shadow.carbon:[[@LINE-5]]:18: note(ReturnedVarHere): `returned var` was declared here // CHECK:STDERR: returned var v: i32 = 0; // CHECK:STDERR: ^ returned var w: i32 = 1; diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index 984504fc7abd8..64f6f97d13ef2 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_returned_var_type.carbon fn Mismatch() -> i32 { - // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE+6]]:19: error: type `f64` of `returned var` does not match return type of enclosing function + // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE+6]]:19: error(ReturnedVarWrongType): type `f64` of `returned var` does not match return type of enclosing function // CHECK:STDERR: returned var v: f64 = 0.0; // CHECK:STDERR: ^~~ - // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE-4]]:15: note: return type of function is `i32` + // CHECK:STDERR: fail_returned_var_type.carbon:[[@LINE-4]]:15: note(ReturnTypeHereNote): return type of function is `i32` // CHECK:STDERR: fn Mismatch() -> i32 { // CHECK:STDERR: ^~~~~~ returned var v: f64 = 0.0; diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index c77c8a6414131..2462b3d40d407 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_type_mismatch.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error: cannot implicitly convert from `f64` to `i32` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+6]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ - // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note: type `f64` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:3: note(MissingImplInMemberAccessNote): type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: return 1.0; // CHECK:STDERR: ^~~~~~~~~~~ return 1.0; diff --git a/toolchain/check/testdata/return/fail_value_disallowed.carbon b/toolchain/check/testdata/return/fail_value_disallowed.carbon index 179d7b156e6a7..3b9dd91f0ddc3 100644 --- a/toolchain/check/testdata/return/fail_value_disallowed.carbon +++ b/toolchain/check/testdata/return/fail_value_disallowed.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_value_disallowed.carbon fn Main() { - // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+6]]:3: error: no return expression should be provided in this context + // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE+6]]:3: error(ReturnStatementDisallowExpr): no return expression should be provided in this context // CHECK:STDERR: return 0; // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE-4]]:1: note: there was no return type provided + // CHECK:STDERR: fail_value_disallowed.carbon:[[@LINE-4]]:1: note(ReturnTypeOmittedNote): there was no return type provided // CHECK:STDERR: fn Main() { // CHECK:STDERR: ^~~~~~~~~~~ return 0; diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 1786b7c01d228..a27b8089bfd1b 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_value_missing.carbon fn Main() -> i32 { - // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+6]]:3: error: missing return value + // CHECK:STDERR: fail_value_missing.carbon:[[@LINE+6]]:3: error(ReturnStatementMissingExpr): missing return value // CHECK:STDERR: return; // CHECK:STDERR: ^~~~~~~ - // CHECK:STDERR: fail_value_missing.carbon:[[@LINE-4]]:11: note: return type of function is `i32` + // CHECK:STDERR: fail_value_missing.carbon:[[@LINE-4]]:11: note(ReturnTypeHereNote): return type of function is `i32` // CHECK:STDERR: fn Main() -> i32 { // CHECK:STDERR: ^~~~~~ return; diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index 15bfdcc037ad3..db19d34cadb2f 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/return/fail_var_in_type.carbon var x: type = i32; -// CHECK:STDERR: fail_var_in_type.carbon:[[@LINE+3]]:13: error: cannot evaluate type expression +// CHECK:STDERR: fail_var_in_type.carbon:[[@LINE+3]]:13: error(TypeExprEvaluationFailure): cannot evaluate type expression // CHECK:STDERR: fn Six() -> x { return 6; } // CHECK:STDERR: ^ fn Six() -> x { return 6; } diff --git a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon index 4197321104907..d64f12081ec43 100644 --- a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon +++ b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_access_into_invalid.carbon -// CHECK:STDERR: fail_access_into_invalid.carbon:[[@LINE+3]]:10: error: name `a` not found +// CHECK:STDERR: fail_access_into_invalid.carbon:[[@LINE+3]]:10: error(NameNotFound): name `a` not found // CHECK:STDERR: fn F() { a.b; } // CHECK:STDERR: ^ fn F() { a.b; } diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index d325a3d399a75..8099944038fa6 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_assign_empty.carbon -// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:20: error: cannot initialize struct with 1 field from struct with 0 fields +// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:20: error(StructInitElementCountMismatch): cannot initialize struct with 1 field from struct with 0 fields // CHECK:STDERR: var x: {.a: i32} = {}; // CHECK:STDERR: ^~ var x: {.a: i32} = {}; diff --git a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon index bab28f527ee75..34fb594c01308 100644 --- a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_assign_to_empty.carbon -// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: error: cannot initialize struct with 0 fields from struct with 1 field +// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: error(StructInitElementCountMismatch): cannot initialize struct with 0 fields from struct with 1 field // CHECK:STDERR: var x: {} = {.a = 1}; // CHECK:STDERR: ^~~~~~~~ var x: {} = {.a = 1}; diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index 72f8014b287cd..14f6e92a79fae 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -8,46 +8,46 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_duplicate_name.carbon -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:42: error: duplicated field name `abc` in struct type literal +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:42: error(StructNameDuplicate): duplicated field name `abc` in struct type literal // CHECK:STDERR: fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: note: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: note(StructNamePrevious): field with the same name here // CHECK:STDERR: fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; // CHECK:STDERR: ^~~ // CHECK:STDERR: fn F() -> {.d: i32, .abc: i32, .e: i32, .abc: i32, .f: i32}; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:19: error: duplicated field name `a` in struct type literal +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:19: error(StructNameDuplicate): duplicated field name `a` in struct type literal // CHECK:STDERR: let v: {.a: i32, .a: i32} = {.a = 1}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:10: note: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:10: note(StructNamePrevious): field with the same name here // CHECK:STDERR: let v: {.a: i32, .a: i32} = {.a = 1}; // CHECK:STDERR: ^ // CHECK:STDERR: let v: {.a: i32, .a: i32} = {.a = 1}; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:26: error: duplicated field name `def` in struct literal +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:26: error(StructNameDuplicate): duplicated field name `def` in struct literal // CHECK:STDERR: let w: i32 = {.def = 1, .def = 2}.def; // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:16: note: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:16: note(StructNamePrevious): field with the same name here // CHECK:STDERR: let w: i32 = {.def = 1, .def = 2}.def; // CHECK:STDERR: ^~~ // CHECK:STDERR: let w: i32 = {.def = 1, .def = 2}.def; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:30: error: duplicated field name `a` in struct literal +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+7]]:30: error(StructNameDuplicate): duplicated field name `a` in struct literal // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: note: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+4]]:22: note(StructNamePrevious): field with the same name here // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; // CHECK:STDERR: ^ // CHECK:STDERR: var x: {.a: i32} = {.a = 1, .a = 2}; -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+6]]:39: error: duplicated field name `b` in struct literal +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+6]]:39: error(StructNameDuplicate): duplicated field name `b` in struct literal // CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDERR: ^ -// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+3]]:31: note: field with the same name here +// CHECK:STDERR: fail_duplicate_name.carbon:[[@LINE+3]]:31: note(StructNamePrevious): field with the same name here // CHECK:STDERR: var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDERR: ^ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index 6088be4dccdee..2cd5a039a98e8 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -8,13 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_field_name_mismatch.carbon -// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+4]]:20: error: missing value for field `a` in struct initialization +// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+4]]:20: error(StructInitMissingFieldInLiteral): missing value for field `a` in struct initialization // CHECK:STDERR: var x: {.a: i32} = {.b = 1}; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: var x: {.a: i32} = {.b = 1}; -// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+3]]:20: error: cannot convert from struct type `{.a: i32}` to `{.b: i32}`: missing field `b` in source type +// CHECK:STDERR: fail_field_name_mismatch.carbon:[[@LINE+3]]:20: error(StructInitMissingFieldInConversion): cannot convert from struct type `{.a: i32}` to `{.b: i32}`: missing field `b` in source type // CHECK:STDERR: var y: {.b: i32} = x; // CHECK:STDERR: ^ var y: {.b: i32} = x; diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index 829c8ce4c5d35..7dbc6defcd83c 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_field_type_mismatch.carbon -// CHECK:STDERR: fail_field_type_mismatch.carbon:[[@LINE+3]]:20: error: missing value for field `a` in struct initialization +// CHECK:STDERR: fail_field_type_mismatch.carbon:[[@LINE+3]]:20: error(StructInitMissingFieldInLiteral): missing value for field `a` in struct initialization // CHECK:STDERR: var x: {.a: i32} = {.b = 1.0}; // CHECK:STDERR: ^~~~~~~~~~ var x: {.a: i32} = {.b = 1.0}; diff --git a/toolchain/check/testdata/struct/fail_keyword_name.carbon b/toolchain/check/testdata/struct/fail_keyword_name.carbon index c092a98030658..2e84a8ad8101b 100644 --- a/toolchain/check/testdata/struct/fail_keyword_name.carbon +++ b/toolchain/check/testdata/struct/fail_keyword_name.carbon @@ -8,17 +8,17 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_keyword_name.carbon -// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+8]]:13: error: expected identifier after `.` +// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+8]]:13: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: fn F() -> {.class: i32}; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+4]]:13: error: semantics TODO: `Error recovery from keyword name.` +// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+4]]:13: error(SemanticsTodo): semantics TODO: `Error recovery from keyword name.` // CHECK:STDERR: fn F() -> {.class: i32}; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: fn F() -> {.class: i32}; -// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+3]]:19: error: expected identifier after `.` +// CHECK:STDERR: fail_keyword_name.carbon:[[@LINE+3]]:19: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: fn G() { return {.return = 5}; }; // CHECK:STDERR: ^~~~~~ fn G() { return {.return = 5}; }; diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index ecadd796458d8..0ee3fa2240a7d 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_member_access_type.carbon var x: {.a: f64} = {.a = 4.0}; -// CHECK:STDERR: fail_member_access_type.carbon:[[@LINE+3]]:14: error: type `{.a: f64}` does not have a member `b` +// CHECK:STDERR: fail_member_access_type.carbon:[[@LINE+3]]:14: error(QualifiedExprNameNotFound): type `{.a: f64}` does not have a member `b` // CHECK:STDERR: var y: i32 = x.b; // CHECK:STDERR: ^~~ var y: i32 = x.b; diff --git a/toolchain/check/testdata/struct/fail_member_of_function.carbon b/toolchain/check/testdata/struct/fail_member_of_function.carbon index 9063762315a32..7d888fe888b26 100644 --- a/toolchain/check/testdata/struct/fail_member_of_function.carbon +++ b/toolchain/check/testdata/struct/fail_member_of_function.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_member_of_function.carbon fn A() { - // CHECK:STDERR: fail_member_of_function.carbon:[[@LINE+3]]:3: error: expression cannot be used as a value + // CHECK:STDERR: fail_member_of_function.carbon:[[@LINE+3]]:3: error(UseOfNonExprAsValue): expression cannot be used as a value // CHECK:STDERR: A.y; // CHECK:STDERR: ^ A.y; diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 13d54c6a99488..4b083796feec1 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_non_member_access.carbon var x: {.a: i32} = {.a = 4}; -// CHECK:STDERR: fail_non_member_access.carbon:[[@LINE+3]]:14: error: type `{.a: i32}` does not have a member `b` +// CHECK:STDERR: fail_non_member_access.carbon:[[@LINE+3]]:14: error(QualifiedExprNameNotFound): type `{.a: i32}` does not have a member `b` // CHECK:STDERR: var y: i32 = x.b; // CHECK:STDERR: ^~~ var y: i32 = x.b; diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index 188b97e3bb7e9..4c100edd68668 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_too_few_values.carbon -// CHECK:STDERR: fail_too_few_values.carbon:[[@LINE+3]]:29: error: cannot initialize struct with 2 fields from struct with 1 field +// CHECK:STDERR: fail_too_few_values.carbon:[[@LINE+3]]:29: error(StructInitElementCountMismatch): cannot initialize struct with 2 fields from struct with 1 field // CHECK:STDERR: var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDERR: ^~~~~~~~ var x: {.a: i32, .b: i32} = {.a = 1}; diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index 003d319b73a72..25aeca5c7385a 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_type_assign.carbon -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `type` to `{.a: i32}` +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:1: error(ImplicitAsConversionFailure): cannot implicitly convert from `type` to `{.a: i32}` // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: note: type `type` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:1: note(MissingImplInMemberAccessNote): type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: {.a: i32} = {.a: i32}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var x: {.a: i32} = {.a: i32}; diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index a54dc01f25883..2521256dc51be 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_value_as_type.carbon -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `{.a: i32}` to `type` +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error(ImplicitAsConversionFailure): cannot implicitly convert from `{.a: i32}` to `type` // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `{.a: i32}` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note(MissingImplInMemberAccessNote): type `{.a: i32}` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: {.a = 1}; // CHECK:STDERR: ^~~~~~~~ var x: {.a = 1}; diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index 516d9e41de328..016e7a32fbeb1 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -30,11 +30,11 @@ var c: C({.a = 1, .b = 2}) = F(); // --- fail_bad_type.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: missing value for field `a` in struct initialization +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error(StructInitMissingFieldInLiteral): missing value for field `a` in struct initialization // CHECK:STDERR: var c_bad: C({.c = 1, .d = 2}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-4]]:6: in import -// CHECK:STDERR: implicit.carbon:8:1: note: while deducing parameters of generic declared here +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-4]]:6(InImport): in import +// CHECK:STDERR: implicit.carbon:8:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: class C(S:! {.a: i32, .b: i32}) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -43,10 +43,10 @@ var c_bad: C({.c = 1, .d = 2}) = F(); // --- fail_bad_value.impl.carbon impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C` to `C` +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error(ImplicitAsConversionFailure): cannot implicitly convert from `C` to `C` // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note(MissingImplInMemberAccessNote): type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C({.a = 3, .b = 4}) = F(); diff --git a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon b/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon index c37037734f971..34160cea8afc2 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon -// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:19: error: missing value for field `a` in struct initialization +// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:19: error(StructInitMissingFieldInLiteral): missing value for field `a` in struct initialization // CHECK:STDERR: var x: {.a: {}} = {.b = {}}; // CHECK:STDERR: ^~~~~~~~~ var x: {.a: {}} = {.b = {}}; diff --git a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon index 2a2937fde0e60..078752f9fbf8a 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon @@ -10,10 +10,10 @@ class Incomplete; -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error: variable has incomplete type `{.a: Incomplete}` +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error(IncompleteTypeInVarDecl): variable has incomplete type `{.a: Incomplete}` // CHECK:STDERR: var s: {.a: Incomplete}; // CHECK:STDERR: ^~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: note: class was forward declared here +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var s: {.a: Incomplete}; diff --git a/toolchain/check/testdata/tuple/access/fail_access_error.carbon b/toolchain/check/testdata/tuple/access/fail_access_error.carbon index dfaa2a79d183a..bad66f3bdc817 100644 --- a/toolchain/check/testdata/tuple/access/fail_access_error.carbon +++ b/toolchain/check/testdata/tuple/access/fail_access_error.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_access_error.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_access_error.carbon:[[@LINE+3]]:17: error: name `oops` not found +// CHECK:STDERR: fail_access_error.carbon:[[@LINE+3]]:17: error(NameNotFound): name `oops` not found // CHECK:STDERR: var b: i32 = a.(oops); // CHECK:STDERR: ^~~~ var b: i32 = a.(oops); diff --git a/toolchain/check/testdata/tuple/access/fail_empty_access.carbon b/toolchain/check/testdata/tuple/access/fail_empty_access.carbon index 3086d1f9e4368..05b576e158ea4 100644 --- a/toolchain/check/testdata/tuple/access/fail_empty_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_empty_access.carbon @@ -11,7 +11,7 @@ fn F() {} fn Run() { - // CHECK:STDERR: fail_empty_access.carbon:[[@LINE+3]]:3: error: tuple element index `0` is past the end of type `()` + // CHECK:STDERR: fail_empty_access.carbon:[[@LINE+3]]:3: error(TupleIndexOutOfBounds): tuple element index `0` is past the end of type `()` // CHECK:STDERR: F().0; // CHECK:STDERR: ^~~~~ F().0; diff --git a/toolchain/check/testdata/tuple/access/fail_large_index.carbon b/toolchain/check/testdata/tuple/access/fail_large_index.carbon index 6ce95428dd6bf..93cd23f0c4216 100644 --- a/toolchain/check/testdata/tuple/access/fail_large_index.carbon +++ b/toolchain/check/testdata/tuple/access/fail_large_index.carbon @@ -10,12 +10,12 @@ var a: (i32,) = (12,); var b: (i32,) = a; -// CHECK:STDERR: fail_large_index.carbon:[[@LINE+4]]:14: error: tuple element index `1` is past the end of type `(i32,)` +// CHECK:STDERR: fail_large_index.carbon:[[@LINE+4]]:14: error(TupleIndexOutOfBounds): tuple element index `1` is past the end of type `(i32,)` // CHECK:STDERR: var c: i32 = b.1; // CHECK:STDERR: ^~~ // CHECK:STDERR: var c: i32 = b.1; -// CHECK:STDERR: fail_large_index.carbon:[[@LINE+3]]:14: error: tuple element index `2147483647` is past the end of type `(i32,)` +// CHECK:STDERR: fail_large_index.carbon:[[@LINE+3]]:14: error(TupleIndexOutOfBounds): tuple element index `2147483647` is past the end of type `(i32,)` // CHECK:STDERR: var d: i32 = b.(0x7FFF_FFFF); // CHECK:STDERR: ^~~~~~~~~~~~~~~ var d: i32 = b.(0x7FFF_FFFF); diff --git a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon index 251c88759ed4b..9c32a4d578513 100644 --- a/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_negative_indexing.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:17: error: cannot access member of interface `Negate` in type `i32` that does not implement that interface +// CHECK:STDERR: fail_negative_indexing.carbon:[[@LINE+3]]:17: error(MissingImplInMemberAccess): cannot access member of interface `Negate` in type `i32` that does not implement that interface // CHECK:STDERR: var b: i32 = a.(-10); // CHECK:STDERR: ^~~ var b: i32 = a.(-10); diff --git a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon index 801b8c7b2e74a..26ad9454c8cbf 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_deterministic_type.carbon @@ -10,7 +10,7 @@ var a: (i32, i32) = (2, 3); var b: i32 = 0; -// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+3]]:14: error: tuple index must be a constant +// CHECK:STDERR: fail_non_deterministic_type.carbon:[[@LINE+3]]:14: error(TupleIndexNotConstant): tuple index must be a constant // CHECK:STDERR: var c: i32 = a.(b); // CHECK:STDERR: ^~~~~ var c: i32 = a.(b); diff --git a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon index 2cac5965be421..7167bb8e44233 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_non_int_indexing.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+6]]:17: error: cannot implicitly convert from `f64` to `i32` +// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+6]]:17: error(ImplicitAsConversionFailure): cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ -// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: note: type `f64` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_non_int_indexing.carbon:[[@LINE+3]]:17: note(MissingImplInMemberAccessNote): type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var b: i32 = a.(2.6); // CHECK:STDERR: ^~~ var b: i32 = a.(2.6); diff --git a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon index e71d16cd0da7e..b9a3de8764c3f 100644 --- a/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon @@ -9,14 +9,14 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_non_tuple_access.carbon fn Main() { - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:3: error: type `i32` does not support indexing + // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+4]]:3: error(TypeNotIndexable): type `i32` does not support indexing // CHECK:STDERR: 0[1]; // CHECK:STDERR: ^~~~ // CHECK:STDERR: 0[1]; var non_tuple: [i32; 2] = (5, 5); - // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:20: error: type `[i32; 2]` does not support tuple indexing; only tuples can be indexed that way + // CHECK:STDERR: fail_non_tuple_access.carbon:[[@LINE+3]]:20: error(TupleIndexOnANonTupleType): type `[i32; 2]` does not support tuple indexing; only tuples can be indexed that way // CHECK:STDERR: var first: i32 = non_tuple.0; // CHECK:STDERR: ^~~~~~~~~~~ var first: i32 = non_tuple.0; diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon index 1c486a18e90f5..5b828be0cd9be 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_out_of_bound_access.carbon var a: (i32, i32) = (12, 6); -// CHECK:STDERR: fail_out_of_bound_access.carbon:[[@LINE+3]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` +// CHECK:STDERR: fail_out_of_bound_access.carbon:[[@LINE+3]]:14: error(TupleIndexOutOfBounds): tuple element index `2` is past the end of type `(i32, i32)` // CHECK:STDERR: var b: i32 = a.2; // CHECK:STDERR: ^~~ var b: i32 = a.2; diff --git a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon index 0e5b2fed9766a..1bbe0b2d2a6db 100644 --- a/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/access/fail_out_of_bound_not_literal.carbon var a: (i32, i32) = (12, 34); -// CHECK:STDERR: fail_out_of_bound_not_literal.carbon:[[@LINE+3]]:14: error: tuple element index `2` is past the end of type `(i32, i32)` +// CHECK:STDERR: fail_out_of_bound_not_literal.carbon:[[@LINE+3]]:14: error(TupleIndexOutOfBounds): tuple element index `2` is past the end of type `(i32, i32)` // CHECK:STDERR: var b: i32 = a.({.index = 2}.index); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~ var b: i32 = a.({.index = 2}.index); diff --git a/toolchain/check/testdata/tuple/fail_assign_nested.carbon b/toolchain/check/testdata/tuple/fail_assign_nested.carbon index d6caa51d36602..d7a4d3763920e 100644 --- a/toolchain/check/testdata/tuple/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuple/fail_assign_nested.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_assign_nested.carbon -// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:36: error: cannot initialize tuple of 2 elements from tuple with 3 elements +// CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+3]]:36: error(TupleInitElementCountMismatch): cannot initialize tuple of 2 elements from tuple with 3 elements // CHECK:STDERR: var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDERR: ^~~~~~~~~ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); diff --git a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon index a2037f6c9c704..ea6eed089ff08 100644 --- a/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_element_type_mismatch.carbon -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+6]]:21: error: cannot implicitly convert from `f64` to `i32` +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+6]]:21: error(ImplicitAsConversionFailure): cannot implicitly convert from `f64` to `i32` // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ -// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: note: type `f64` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_element_type_mismatch.carbon:[[@LINE+3]]:21: note(MissingImplInMemberAccessNote): type `f64` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (i32, i32) = (2, 65.89); // CHECK:STDERR: ^~~~~~~~~~ var x: (i32, i32) = (2, 65.89); diff --git a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon index 2d6ea52d3c5ff..6eb71f3708dc8 100644 --- a/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuple/fail_nested_incomplete.carbon @@ -10,10 +10,10 @@ class Incomplete; -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error: variable has incomplete type `(i32, Incomplete)` +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE+6]]:8: error(IncompleteTypeInVarDecl): variable has incomplete type `(i32, Incomplete)` // CHECK:STDERR: var t: (i32, Incomplete); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: note: class was forward declared here +// CHECK:STDERR: fail_nested_incomplete.carbon:[[@LINE-5]]:1: note(ClassForwardDeclaredHere): class was forward declared here // CHECK:STDERR: class Incomplete; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~ var t: (i32, Incomplete); diff --git a/toolchain/check/testdata/tuple/fail_too_few_element.carbon b/toolchain/check/testdata/tuple/fail_too_few_element.carbon index e44cb01abd3fc..3452f73b8ab22 100644 --- a/toolchain/check/testdata/tuple/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuple/fail_too_few_element.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_too_few_element.carbon -// CHECK:STDERR: fail_too_few_element.carbon:[[@LINE+3]]:21: error: cannot initialize tuple of 2 elements from tuple with 1 element +// CHECK:STDERR: fail_too_few_element.carbon:[[@LINE+3]]:21: error(TupleInitElementCountMismatch): cannot initialize tuple of 2 elements from tuple with 1 element // CHECK:STDERR: var x: (i32, i32) = (2, ); // CHECK:STDERR: ^~~~~ var x: (i32, i32) = (2, ); diff --git a/toolchain/check/testdata/tuple/fail_type_assign.carbon b/toolchain/check/testdata/tuple/fail_type_assign.carbon index e2c7fe7e1d859..e01d183b5c7a7 100644 --- a/toolchain/check/testdata/tuple/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuple/fail_type_assign.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_type_assign.carbon -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:18: error: cannot implicitly convert from `type` to `i32` +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+6]]:18: error(ImplicitAsConversionFailure): cannot implicitly convert from `type` to `i32` // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: note: type `type` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+3]]:18: note(MissingImplInMemberAccessNote): type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (i32, ) = (i32, ); // CHECK:STDERR: ^~~~~~~ var x: (i32, ) = (i32, ); diff --git a/toolchain/check/testdata/tuple/fail_value_as_type.carbon b/toolchain/check/testdata/tuple/fail_value_as_type.carbon index 69d1459fd1edc..0fdfea3d17755 100644 --- a/toolchain/check/testdata/tuple/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuple/fail_value_as_type.carbon @@ -8,10 +8,10 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/fail_value_as_type.carbon -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+6]]:8: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ -// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_value_as_type.carbon:[[@LINE+3]]:8: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: (1, ); // CHECK:STDERR: ^~~~~ var x: (1, ); diff --git a/toolchain/check/testdata/tuple/import.carbon b/toolchain/check/testdata/tuple/import.carbon index cb2a0d95fa035..2e1ed742e52f5 100644 --- a/toolchain/check/testdata/tuple/import.carbon +++ b/toolchain/check/testdata/tuple/import.carbon @@ -31,11 +31,11 @@ var c: C((1, 2)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: cannot initialize tuple of 2 elements from tuple with 3 elements +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error(TupleInitElementCountMismatch): cannot initialize tuple of 2 elements from tuple with 3 elements // CHECK:STDERR: var c_bad: C((1, 2, 3)) = F(); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:6: in import -// CHECK:STDERR: implicit.carbon:7:1: note: while deducing parameters of generic declared here +// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:6(InImport): in import +// CHECK:STDERR: implicit.carbon:7:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: class C(X:! (i32, i32)) {} // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -45,10 +45,10 @@ var c_bad: C((1, 2, 3)) = F(); impl package Implicit; -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error: cannot implicitly convert from `C` to `C` +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+6]]:1: error(ImplicitAsConversionFailure): cannot implicitly convert from `C` to `C` // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note: type `C` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+3]]:1: note(MissingImplInMemberAccessNote): type `C` does not implement interface `ImplicitAs` // CHECK:STDERR: var c_bad: C((3, 4)) = F(); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ var c_bad: C((3, 4)) = F(); diff --git a/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon b/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon index 336ba90c655e6..bfbe27119e8b2 100644 --- a/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/fail_assign_empty.carbon -// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:16: error: cannot initialize tuple of 1 element from tuple with 0 elements +// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+3]]:16: error(TupleInitElementCountMismatch): cannot initialize tuple of 1 element from tuple with 0 elements // CHECK:STDERR: var x: ((),) = (); // CHECK:STDERR: ^~ var x: ((),) = (); diff --git a/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon b/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon index 2fabe24bb1120..a0d42d3ede2a4 100644 --- a/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/fail_assign_to_empty.carbon -// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: error: cannot initialize tuple of 0 elements from tuple with 1 element +// CHECK:STDERR: fail_assign_to_empty.carbon:[[@LINE+3]]:13: error(TupleInitElementCountMismatch): cannot initialize tuple of 0 elements from tuple with 1 element // CHECK:STDERR: var x: () = ((),); // CHECK:STDERR: ^~~~~ var x: () = ((),); diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 3a45666479169..69c48f3ea9865 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -14,14 +14,14 @@ class X { fn F(x: X) { // TODO: Strings should eventually be copyable, once we decide how to // represent them. - // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:19: error: cannot copy value of type `String` + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+4]]:19: error(CopyOfUncopyableType): cannot copy value of type `String` // CHECK:STDERR: var s: String = "hello"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var s: String = "hello"; // TODO: Decide on rules for when classes are copyable. - // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+3]]:14: error: cannot copy value of type `X` + // CHECK:STDERR: fail_not_copyable.carbon:[[@LINE+3]]:14: error(CopyOfUncopyableType): cannot copy value of type `X` // CHECK:STDERR: var y: X = x; // CHECK:STDERR: ^ var y: X = x; diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index d758b0a7c57b5..106cbdc6358d7 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_storage_is_literal.carbon fn Main() { - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+6]]:10: error: cannot implicitly convert from `i32` to `type` + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+6]]:10: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ - // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: note: type `i32` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: var x: 1 = 1; // CHECK:STDERR: ^ var x: 1 = 1; diff --git a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon index 7149039333a7d..1ce42ca344c3a 100644 --- a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon +++ b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon @@ -8,49 +8,49 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_todo_control_flow_init.carbon -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:13: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:13: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:13: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:21: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:21: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x: () = if true then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var x: () = if true then () else (); -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+12]]:14: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:14: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:14: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:23: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:23: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var x2: () = if false then () else (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var x2: () = if false then () else (); -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:15: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+8]]:15: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var y: bool = true or false; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:15: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+4]]:15: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var y: bool = true or false; // CHECK:STDERR: ^~~~~~~~~~~~~ // CHECK:STDERR: var y: bool = true or false; -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+7]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+7]]:16: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+3]]:16: error: semantics TODO: `Control flow expressions are currently only supported inside functions.` +// CHECK:STDERR: fail_todo_control_flow_init.carbon:[[@LINE+3]]:16: error(SemanticsTodo): semantics TODO: `Control flow expressions are currently only supported inside functions.` // CHECK:STDERR: var y2: bool = false or true; // CHECK:STDERR: ^~~~~~~~~~~~~ var y2: bool = false or true; diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/no_prelude/export_name.carbon index aae308180f4da..6e84fe888d4cd 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/no_prelude/export_name.carbon @@ -34,9 +34,9 @@ export v; library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+5]]:1: in import -// CHECK:STDERR: export.carbon:4:1: in import -// CHECK:STDERR: base.carbon:4:5: error: semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` +// CHECK:STDERR: fail_todo_use_export.carbon:[[@LINE+5]]:1(InImport): in import +// CHECK:STDERR: export.carbon:4:1(InImport): in import +// CHECK:STDERR: base.carbon:4:5: error(SemanticsTodo): semantics TODO: `Non-constant ImportRefLoaded (comes up with var)` // CHECK:STDERR: var v: (); // CHECK:STDERR: ^ import library "export"; diff --git a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon index 1866917f1bae3..ba58c344bd75d 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_duplicate_decl.carbon @@ -11,10 +11,10 @@ fn Main() { var x: () = (); - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error: duplicate name being declared in the same scope + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE+6]]:7: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: var x: () = (); // CHECK:STDERR: ^ - // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note: name is previously declared here + // CHECK:STDERR: fail_duplicate_decl.carbon:[[@LINE-4]]:7: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: var x: () = (); // CHECK:STDERR: ^ var x: () = (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon index b97d21084a437..467aa35538d5a 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_generic.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_generic.carbon fn Main() { - // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:11: error: `var` declaration cannot declare a compile-time binding + // CHECK:STDERR: fail_generic.carbon:[[@LINE+3]]:11: error(CompileTimeBindingInVarDecl): `var` declaration cannot declare a compile-time binding // CHECK:STDERR: var x:! () = (); // CHECK:STDERR: ^~ var x:! () = (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon index fec3593118c98..a684f05d26bbe 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon fn Main() { - // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:3: error: package `Core` implicitly referenced here, but not found + // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+3]]:3: error(CoreNotFound): package `Core` implicitly referenced here, but not found // CHECK:STDERR: var x: {} = (); // CHECK:STDERR: ^~~~~~~~~~~~~~~ var x: {} = (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon index cca74aba81dcc..bef082841c9c6 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_init_with_self.carbon fn Main() { - // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:15: error: name `x` not found + // CHECK:STDERR: fail_init_with_self.carbon:[[@LINE+3]]:15: error(NameNotFound): name `x` not found // CHECK:STDERR: var x: () = x; // CHECK:STDERR: ^ var x: () = x; diff --git a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon index 7274e5dcc9d27..707c9ecded6b6 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_lookup_outside_scope.carbon @@ -12,7 +12,7 @@ fn Main() { var x: (); } -// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:13: error: name `x` not found +// CHECK:STDERR: fail_lookup_outside_scope.carbon:[[@LINE+3]]:13: error(NameNotFound): name `x` not found // CHECK:STDERR: var y: () = x; // CHECK:STDERR: ^ var y: () = x; diff --git a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon index 02aec97a0bafd..9a5815cfb13d9 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon @@ -8,35 +8,35 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error(ModifierProtectedNotAllowed): `protected` not allowed; requires class scope // CHECK:STDERR: protected var b: (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: protected var b: (); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` not allowed on declaration with `private` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error(ModifierNotAllowedWith): `protected` not allowed on declaration with `private` // CHECK:STDERR: private protected var c: (); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `private` previously appeared here // CHECK:STDERR: private protected var c: (); // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: private protected var c: (); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error: `protected` not allowed; requires class scope +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:1: error(ModifierProtectedNotAllowed): `protected` not allowed; requires class scope // CHECK:STDERR: protected protected var d: (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: error: `protected` repeated on declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:11: error(ModifierRepeated): `protected` repeated on declaration // CHECK:STDERR: protected protected var d: (); // CHECK:STDERR: ^~~~~~~~~ -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `protected` previously appeared here +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note(ModifierPrevious): `protected` previously appeared here // CHECK:STDERR: protected protected var d: (); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: protected protected var d: (); -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error: `abstract` not allowed on `var` declaration +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: error(ModifierNotAllowedOnDeclaration): `abstract` not allowed on `var` declaration // CHECK:STDERR: abstract var e: (); // CHECK:STDERR: ^~~~~~~~ abstract var e: (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon index adae75dc1aa8e..bc26029fdb875 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon +++ b/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon @@ -10,19 +10,19 @@ namespace A; -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+7]]:5: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+7]]:5: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: var A: (); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-5]]:1: note: name is previously declared here +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-5]]:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: namespace A; // CHECK:STDERR: ^~~~~~~~~~~~ // CHECK:STDERR: var A: (); -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+6]]:5: error: duplicate name being declared in the same scope +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE+6]]:5: error(NameDeclDuplicate): duplicate name being declared in the same scope // CHECK:STDERR: var A: () = (); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-14]]:1: note: name is previously declared here +// CHECK:STDERR: fail_namespace_conflict.carbon:[[@LINE-14]]:1: note(NameDeclPrevious): name is previously declared here // CHECK:STDERR: namespace A; // CHECK:STDERR: ^~~~~~~~~~~~ var A: () = (); diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index d071696e155f1..a063bce764206 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -34,7 +34,7 @@ package Test library "[[@TEST_NAME]]"; import library "def"; -// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:14: error: name `v` not found +// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:14: error(NameNotFound): name `v` not found // CHECK:STDERR: var v2: () = v; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -46,7 +46,7 @@ package Other library "[[@TEST_NAME]]"; import Test library "def"; -// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error: name `v` not found +// CHECK:STDERR: fail_other_def.carbon:[[@LINE+3]]:14: error(NameNotFound): name `v` not found // CHECK:STDERR: var v2: () = Test.v; // CHECK:STDERR: ^~~~~~ var v2: () = Test.v; diff --git a/toolchain/check/testdata/where_expr/constraints.carbon b/toolchain/check/testdata/where_expr/constraints.carbon index b77ce7af8b590..0a073d0a60975 100644 --- a/toolchain/check/testdata/where_expr/constraints.carbon +++ b/toolchain/check/testdata/where_expr/constraints.carbon @@ -33,10 +33,10 @@ interface N { let P:! type; } -// CHECK:STDERR: fail_todo_equal_constraint.carbon:[[@LINE+7]]:27: error: cannot implicitly convert from `{}` to `` +// CHECK:STDERR: fail_todo_equal_constraint.carbon:[[@LINE+7]]:27: error(ImplicitAsConversionFailure): cannot implicitly convert from `{}` to `` // CHECK:STDERR: fn Equal(T:! N where .P = {}); // CHECK:STDERR: ^~ -// CHECK:STDERR: fail_todo_equal_constraint.carbon:[[@LINE+4]]:27: note: type `{}` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_todo_equal_constraint.carbon:[[@LINE+4]]:27: note(MissingImplInMemberAccessNote): type `{}` does not implement interface `ImplicitAs` // CHECK:STDERR: fn Equal(T:! N where .P = {}); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -53,10 +53,10 @@ interface K { let Associated:! L; } -// CHECK:STDERR: fail_todo_associated_type_impls.carbon:[[@LINE+7]]:36: error: cannot implicitly convert from `` to `type` +// CHECK:STDERR: fail_todo_associated_type_impls.carbon:[[@LINE+7]]:36: error(ImplicitAsConversionFailure): cannot implicitly convert from `` to `type` // CHECK:STDERR: fn AssociatedTypeImpls(W:! K where .Associated impls M); // CHECK:STDERR: ^~~~~~~~~~~ -// CHECK:STDERR: fail_todo_associated_type_impls.carbon:[[@LINE+4]]:36: note: type `` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_todo_associated_type_impls.carbon:[[@LINE+4]]:36: note(MissingImplInMemberAccessNote): type `` does not implement interface `ImplicitAs` // CHECK:STDERR: fn AssociatedTypeImpls(W:! K where .Associated impls M); // CHECK:STDERR: ^~~~~~~~~~~ // CHECK:STDERR: @@ -71,10 +71,10 @@ import library "state_constraints"; // `2` can't be converted to the type of `I.Member` // TODO: The diagnostics are wrong since member access into facets isn't // working properly yet. -// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+7]]:46: error: cannot implicitly convert from `i32` to `` +// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+7]]:46: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `` // CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+4]]:46: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+4]]:46: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -84,10 +84,10 @@ fn RewriteTypeMismatch(X:! I where .Member = 2); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+7]]:32: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+7]]:32: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: fn NonTypeImpls(U:! type where 7 impls type); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+4]]:32: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+4]]:32: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: fn NonTypeImpls(U:! type where 7 impls type); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -97,10 +97,10 @@ fn NonTypeImpls(U:! type where 7 impls type); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+7]]:44: error: cannot implicitly convert from `i32` to `type` +// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+7]]:44: error(ImplicitAsConversionFailure): cannot implicitly convert from `i32` to `type` // CHECK:STDERR: fn ImplsNonType(U:! type where .Self impls 7); // CHECK:STDERR: ^ -// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+4]]:44: note: type `i32` does not implement interface `ImplicitAs` +// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+4]]:44: note(MissingImplInMemberAccessNote): type `i32` does not implement interface `ImplicitAs` // CHECK:STDERR: fn ImplsNonType(U:! type where .Self impls 7); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -110,7 +110,7 @@ fn ImplsNonType(U:! type where .Self impls 7); library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_right_of_impls_non_facet_type.carbon:[[@LINE+4]]:51: error: right argument of `impls` requirement must be a facet type +// CHECK:STDERR: fail_right_of_impls_non_facet_type.carbon:[[@LINE+4]]:51: error(ImplsOnNonFacetType): right argument of `impls` requirement must be a facet type // CHECK:STDERR: fn ImplsOfNonFacetType(U:! type where .Self impls i32); // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -128,14 +128,14 @@ impl C as J {} // TODO: Should report that `C` does not meet the constraint. fn DoesNotImplI() { - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+11]]:3: error: cannot implicitly convert from `type` to `J` + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+11]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `type` to `J` // CHECK:STDERR: Impls(C); // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+8]]:3: note: type `type` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+8]]:3: note(MissingImplInMemberAccessNote): type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: Impls(C); // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-14]]:1: in import - // CHECK:STDERR: state_constraints.carbon:13:1: note: while deducing parameters of generic declared here + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-14]]:1(InImport): in import + // CHECK:STDERR: state_constraints.carbon:13:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: fn Impls(V:! J where .Self impls I); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CHECK:STDERR: @@ -146,13 +146,13 @@ fn EmptyStruct(Y:! J where .Self == {}); // TODO: Should report that `C` does not meeet the constraint. fn NotEmptyStruct() { - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+9]]:3: error: cannot implicitly convert from `type` to `J` + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+9]]:3: error(ImplicitAsConversionFailure): cannot implicitly convert from `type` to `J` // CHECK:STDERR: EmptyStruct(C); // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+6]]:3: note: type `type` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE+6]]:3: note(MissingImplInMemberAccessNote): type `type` does not implement interface `ImplicitAs` // CHECK:STDERR: EmptyStruct(C); // CHECK:STDERR: ^~~~~~~~~~~~ - // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-10]]:1: note: while deducing parameters of generic declared here + // CHECK:STDERR: fail_todo_enforce_constraint.carbon:[[@LINE-10]]:1: note(DeductionGenericHere): while deducing parameters of generic declared here // CHECK:STDERR: fn EmptyStruct(Y:! J where .Self == {}); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EmptyStruct(C); diff --git a/toolchain/check/testdata/where_expr/designator.carbon b/toolchain/check/testdata/where_expr/designator.carbon index 52b8b749d2380..f4285e541e9f8 100644 --- a/toolchain/check/testdata/where_expr/designator.carbon +++ b/toolchain/check/testdata/where_expr/designator.carbon @@ -30,7 +30,7 @@ interface J { let Member:! type; } -// CHECK:STDERR: fail_wrong_member.carbon:[[@LINE+4]]:31: error: name `Mismatch` not found +// CHECK:STDERR: fail_wrong_member.carbon:[[@LINE+4]]:31: error(NameNotFound): name `Mismatch` not found // CHECK:STDERR: fn PeriodMismatch(W:! J where .Mismatch = {}); // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: @@ -42,10 +42,10 @@ library "[[@TEST_NAME]]"; fn Foo() -> () { var x: (); - // CHECK:STDERR: fail_designator_matches_var.carbon:[[@LINE+5]]:10: error: name `.Self` not found + // CHECK:STDERR: fail_designator_matches_var.carbon:[[@LINE+5]]:10: error(NameNotFound): name `.Self` not found // CHECK:STDERR: return .x; // CHECK:STDERR: ^~ - // CHECK:STDERR: fail_designator_matches_var.carbon: note: designator may only be used when `.Self` is in scope + // CHECK:STDERR: fail_designator_matches_var.carbon: note(NoPeriodSelfForDesignator): designator may only be used when `.Self` is in scope // CHECK:STDERR: return .x; } @@ -55,10 +55,10 @@ fn Foo() -> () { library "[[@TEST_NAME]]"; fn Bar() -> () { - // CHECK:STDERR: fail_unknown_designator.carbon:[[@LINE+5]]:10: error: name `.Self` not found + // CHECK:STDERR: fail_unknown_designator.carbon:[[@LINE+5]]:10: error(NameNotFound): name `.Self` not found // CHECK:STDERR: return .undef; // CHECK:STDERR: ^~~~~~ - // CHECK:STDERR: fail_unknown_designator.carbon: note: designator may only be used when `.Self` is in scope + // CHECK:STDERR: fail_unknown_designator.carbon: note(NoPeriodSelfForDesignator): designator may only be used when `.Self` is in scope // CHECK:STDERR: return .undef; } @@ -68,7 +68,7 @@ fn Bar() -> () { library "[[@TEST_NAME]]"; class C { - // CHECK:STDERR: fail_dot_self_method_return_value.carbon:[[@LINE+4]]:27: error: name `.Self` not found + // CHECK:STDERR: fail_dot_self_method_return_value.carbon:[[@LINE+4]]:27: error(NameNotFound): name `.Self` not found // CHECK:STDERR: fn F() -> Self { return .Self; } // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -80,7 +80,7 @@ class C { library "[[@TEST_NAME]]"; class D { - // CHECK:STDERR: fail_dot_self_method_return_type.carbon:[[@LINE+3]]:13: error: name `.Self` not found + // CHECK:STDERR: fail_dot_self_method_return_type.carbon:[[@LINE+3]]:13: error(NameNotFound): name `.Self` not found // CHECK:STDERR: fn G() -> .Self { return Self; } // CHECK:STDERR: ^~~~~ fn G() -> .Self { return Self; } diff --git a/toolchain/check/testdata/where_expr/fail_not_facet.carbon b/toolchain/check/testdata/where_expr/fail_not_facet.carbon index 9af98db6487a8..b253238cdaa8c 100644 --- a/toolchain/check/testdata/where_expr/fail_not_facet.carbon +++ b/toolchain/check/testdata/where_expr/fail_not_facet.carbon @@ -12,7 +12,7 @@ library "[[@TEST_NAME]]"; -// CHECK:STDERR: fail_left_where_not_facet.carbon:[[@LINE+3]]:10: error: left argument of `where` operator must be a facet type +// CHECK:STDERR: fail_left_where_not_facet.carbon:[[@LINE+3]]:10: error(WhereOnNonFacetType): left argument of `where` operator must be a facet type // CHECK:STDERR: fn F(T:! i32 where .Self == bool); // CHECK:STDERR: ^~~ fn F(T:! i32 where .Self == bool); diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index 2d7f28befeff6..f2512dcaee80d 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/while/fail_bad_condition.carbon fn While() { - // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: error: cannot implicitly convert from `String` to `bool` + // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+6]]:9: error(ImplicitAsConversionFailure): cannot implicitly convert from `String` to `bool` // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ - // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: note: type `String` does not implement interface `ImplicitAs` + // CHECK:STDERR: fail_bad_condition.carbon:[[@LINE+3]]:9: note(MissingImplInMemberAccessNote): type `String` does not implement interface `ImplicitAs` // CHECK:STDERR: while ("Hello") {} // CHECK:STDERR: ^~~~~~~~~ while ("Hello") {} diff --git a/toolchain/check/testdata/while/fail_break_continue.carbon b/toolchain/check/testdata/while/fail_break_continue.carbon index a2f01b1d2d05b..91318dc532cbc 100644 --- a/toolchain/check/testdata/while/fail_break_continue.carbon +++ b/toolchain/check/testdata/while/fail_break_continue.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/while/fail_break_continue.carbon fn While() { - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `continue` can only be used in a loop + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error(ContinueOutsideLoop): `continue` can only be used in a loop // CHECK:STDERR: continue; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: continue; - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `break` can only be used in a loop + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error(BreakOutsideLoop): `break` can only be used in a loop // CHECK:STDERR: break; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -23,12 +23,12 @@ fn While() { continue; break; } - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error: `continue` can only be used in a loop + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+4]]:3: error(ContinueOutsideLoop): `continue` can only be used in a loop // CHECK:STDERR: continue; // CHECK:STDERR: ^~~~~~~~ // CHECK:STDERR: continue; - // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+3]]:3: error: `break` can only be used in a loop + // CHECK:STDERR: fail_break_continue.carbon:[[@LINE+3]]:3: error(BreakOutsideLoop): `break` can only be used in a loop // CHECK:STDERR: break; // CHECK:STDERR: ^~~~~ break; diff --git a/toolchain/diagnostics/diagnostic_consumer.cpp b/toolchain/diagnostics/diagnostic_consumer.cpp index 92871aabecb8a..7924124f5e9c1 100644 --- a/toolchain/diagnostics/diagnostic_consumer.cpp +++ b/toolchain/diagnostics/diagnostic_consumer.cpp @@ -18,21 +18,23 @@ auto StreamDiagnosticConsumer::HandleDiagnostic(Diagnostic diagnostic) -> void { for (const auto& message : diagnostic.messages) { message.loc.FormatLocation(*stream_); - *stream_ << ": "; switch (message.level) { case DiagnosticLevel::Error: - *stream_ << "error: "; + *stream_ << ": error"; break; case DiagnosticLevel::Warning: - *stream_ << "warning: "; + *stream_ << ": warning"; break; case DiagnosticLevel::Note: - *stream_ << "note: "; + *stream_ << ": note"; break; case DiagnosticLevel::LocationInfo: break; } - *stream_ << message.format_fn(message) << "\n"; + if (include_diagnostic_kind_) { + *stream_ << "(" << message.kind << ")"; + } + *stream_ << ": " << message.format_fn(message) << "\n"; // Don't include a snippet for location information to keep this diagnostic // more visually associated with the following diagnostic that it describes // and to better match C++ compilers. @@ -43,7 +45,8 @@ auto StreamDiagnosticConsumer::HandleDiagnostic(Diagnostic diagnostic) -> void { } auto ConsoleDiagnosticConsumer() -> DiagnosticConsumer& { - static auto* consumer = new StreamDiagnosticConsumer(llvm::errs()); + static auto* consumer = new StreamDiagnosticConsumer( + llvm::errs(), /*include_diagnostic_kind=*/false); return *consumer; } diff --git a/toolchain/diagnostics/diagnostic_consumer.h b/toolchain/diagnostics/diagnostic_consumer.h index e43f2af12f229..39dfff115c145 100644 --- a/toolchain/diagnostics/diagnostic_consumer.h +++ b/toolchain/diagnostics/diagnostic_consumer.h @@ -39,8 +39,9 @@ class DiagnosticConsumer { // A diagnostic consumer that prints to a stream. class StreamDiagnosticConsumer : public DiagnosticConsumer { public: - explicit StreamDiagnosticConsumer(llvm::raw_ostream& stream) - : stream_(&stream) {} + explicit StreamDiagnosticConsumer(llvm::raw_ostream& stream, + bool include_diagnostic_kind) + : stream_(&stream), include_diagnostic_kind_(include_diagnostic_kind) {} auto HandleDiagnostic(Diagnostic diagnostic) -> void override; auto Flush() -> void override { stream_->flush(); } @@ -51,6 +52,10 @@ class StreamDiagnosticConsumer : public DiagnosticConsumer { auto Print(const DiagnosticMessage& message, llvm::StringRef prefix) -> void; llvm::raw_ostream* stream_; + + // Whether to include the diagnostic kind when printing. + bool include_diagnostic_kind_; + // Whethere we've printed a diagnostic. Used for printing separators. bool printed_diagnostic_ = false; }; diff --git a/toolchain/driver/compile_subcommand.cpp b/toolchain/driver/compile_subcommand.cpp index 67a84c2bae5ea..729f4e3243ed0 100644 --- a/toolchain/driver/compile_subcommand.cpp +++ b/toolchain/driver/compile_subcommand.cpp @@ -141,6 +141,15 @@ of a binary object file instead. Ignored for other `--output` values. }, [&](auto& arg_b) { arg_b.Set(&force_obj_output); }); + b.AddFlag( + { + .name = "include-diagnostic-kind", + .help = R"""( +When printing diagnostics, include the diagnostic kind as part of output. This +applies to each message that forms a diagnostic, not just the primary message. +)""", + }, + [&](auto& arg_b) { arg_b.Set(&include_diagnostic_kind); }); b.AddFlag( { .name = "stream-errors", @@ -635,7 +644,8 @@ auto CompileSubcommand::Run(DriverEnv& driver_env) -> DriverResult { } // Prepare CompilationUnits before building scope exit handlers. - StreamDiagnosticConsumer stream_consumer(driver_env.error_stream); + StreamDiagnosticConsumer stream_consumer(driver_env.error_stream, + options_.include_diagnostic_kind); llvm::SmallVector> units; units.reserve(prelude.size() + options_.input_filenames.size()); diff --git a/toolchain/driver/compile_subcommand.h b/toolchain/driver/compile_subcommand.h index 4267a67aec3fb..af01d07bbb16d 100644 --- a/toolchain/driver/compile_subcommand.h +++ b/toolchain/driver/compile_subcommand.h @@ -51,6 +51,7 @@ struct CompileOptions { bool dump_llvm_ir = false; bool dump_asm = false; bool dump_mem_usage = false; + bool include_diagnostic_kind = false; bool stream_errors = false; bool preorder_parse_tree = false; bool builtin_sem_ir = false; diff --git a/toolchain/driver/format_subcommand.cpp b/toolchain/driver/format_subcommand.cpp index d048148f5d094..33af433b0ca0b 100644 --- a/toolchain/driver/format_subcommand.cpp +++ b/toolchain/driver/format_subcommand.cpp @@ -64,7 +64,8 @@ auto FormatSubcommand::Run(DriverEnv& driver_env) -> DriverResult { result.per_file_success.back().second = false; }; - StreamDiagnosticConsumer consumer(driver_env.error_stream); + StreamDiagnosticConsumer consumer(driver_env.error_stream, + /*include_diagnostic_kind=*/false); for (auto& f : options_.input_filenames) { // Push a result, which we'll update on failure. result.per_file_success.push_back({f.str(), true}); diff --git a/toolchain/lex/testdata/fail_bad_comment_introducers.carbon b/toolchain/lex/testdata/fail_bad_comment_introducers.carbon index f1ce40843f9a6..5365d746ca9e3 100644 --- a/toolchain/lex/testdata/fail_bad_comment_introducers.carbon +++ b/toolchain/lex/testdata/fail_bad_comment_introducers.carbon @@ -13,13 +13,13 @@ // // Comments have to have whitespace after `//` currently. -// CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:3: error: whitespace is required after '//' +// CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:3: error(NoWhitespaceAfterCommentIntroducer): whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDERR: //abc - // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:7: error: whitespace is required after '//' + // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:7: error(NoWhitespaceAfterCommentIntroducer): whitespace is required after '//' // CHECK:STDERR: //indented // CHECK:STDERR: ^ // CHECK:STDERR: @@ -28,7 +28,7 @@ // We only want to diagnose these on the first line of a block of similarly // indented comments. -// CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:3: error: whitespace is required after '//' +// CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:3: error(NoWhitespaceAfterCommentIntroducer): whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDERR: @@ -36,7 +36,7 @@ //123 //dce - // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:11: error: whitespace is required after '//' + // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+4]]:11: error(NoWhitespaceAfterCommentIntroducer): whitespace is required after '//' // CHECK:STDERR: //indented block // CHECK:STDERR: ^ // CHECK:STDERR: @@ -48,7 +48,7 @@ // As we have specialized code to scan short indented comment blocks, make sure // the behavior is preserved even for (absurdly) large indents. - // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+3]]:83: error: whitespace is required after '//' + // CHECK:STDERR: fail_bad_comment_introducers.carbon:[[@LINE+3]]:83: error(NoWhitespaceAfterCommentIntroducer): whitespace is required after '//' // CHECK:STDERR: //very indented block // CHECK:STDERR: ^ //very indented block diff --git a/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon b/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon index 7a624b8f2f03a..fa3ad6558ff08 100644 --- a/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon +++ b/toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon @@ -23,15 +23,15 @@ // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_bad_comment_introducers_mid_block_indent_change.carbon -// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-17]]:3: error: whitespace is required after '//' +// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-17]]:3: error(NoWhitespaceAfterCommentIntroducer): whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-18]]:5: error: whitespace is required after '//' +// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-18]]:5: error(NoWhitespaceAfterCommentIntroducer): whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-19]]:3: error: whitespace is required after '//' +// CHECK:STDERR: fail_bad_comment_introducers_mid_block_indent_change.carbon:[[@LINE-19]]:3: error(NoWhitespaceAfterCommentIntroducer): whitespace is required after '//' // CHECK:STDERR: //abc // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_bad_comment_introducers_mid_block_indent_change.carbon diff --git a/toolchain/lex/testdata/fail_bad_raw_identifier.carbon b/toolchain/lex/testdata/fail_bad_raw_identifier.carbon index 09370934763fe..ebf42a5f97797 100644 --- a/toolchain/lex/testdata/fail_bad_raw_identifier.carbon +++ b/toolchain/lex/testdata/fail_bad_raw_identifier.carbon @@ -15,7 +15,7 @@ // Missing the character after `#`. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: r# // CHECK:STDERR: ^ // CHECK:STDERR: @@ -24,7 +24,7 @@ r# // CHECK:STDOUT: { index: 2, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#' }, // Not a valid identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: r#3 // CHECK:STDERR: ^ // CHECK:STDERR: @@ -34,7 +34,7 @@ r#3 // CHECK:STDOUT: { index: 5, kind: 'IntLiteral', line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: '3', value: `3` }, // Non ascii start to identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: r#á // CHECK:STDERR: ^ // CHECK:STDERR: @@ -43,7 +43,7 @@ r#á // CHECK:STDOUT: { index: 7, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 2, indent: 1, spelling: '#á' }, // Raw `r` identifier doesn't start a second raw identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: r#r#foo // CHECK:STDERR: ^ // CHECK:STDERR: @@ -53,7 +53,7 @@ r#r#foo // CHECK:STDOUT: { index: 10, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: 'foo', identifier: 1 }, // Other identifier characters don't start a raw identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:2: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: s#foo // CHECK:STDERR: ^ // CHECK:STDERR: @@ -63,7 +63,7 @@ s#foo // CHECK:STDOUT: { index: 13, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 3, indent: 1, spelling: 'foo', identifier: 1 }, // Identifier ending in `r` doesn't start a raw identifier. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:4: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: arr#foo // CHECK:STDERR: ^ // CHECK:STDERR: @@ -73,7 +73,7 @@ arr#foo // CHECK:STDOUT: { index: 16, kind: 'Identifier', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: 'foo', identifier: 1 }, // Whitespace between `r` and `#` isn't allowed. -// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:3: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_bad_raw_identifier.carbon:[[@LINE+4]]:3: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: r #foo // CHECK:STDERR: ^ // CHECK:STDERR: @@ -95,7 +95,7 @@ r#"hello"# // CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }, // Ensure that we correctly handle a `#` as the first token in the file. -// CHECK:STDERR: fail_hash_at_start_of_file.carbon:[[@LINE+3]]:1: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_hash_at_start_of_file.carbon:[[@LINE+3]]:1: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: #foo // CHECK:STDERR: ^ #foo diff --git a/toolchain/lex/testdata/fail_block_string_second_line.carbon b/toolchain/lex/testdata/fail_block_string_second_line.carbon index 7fa8f18eae5a6..93385a96d7ed5 100644 --- a/toolchain/lex/testdata/fail_block_string_second_line.carbon +++ b/toolchain/lex/testdata/fail_block_string_second_line.carbon @@ -13,7 +13,7 @@ var s: String = ''' // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_block_string_second_line.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_block_string_second_line.carbon -// CHECK:STDERR: fail_block_string_second_line.carbon:[[@LINE-10]]:3: error: only whitespace is permitted before the closing `'''` of a multi-line string +// CHECK:STDERR: fail_block_string_second_line.carbon:[[@LINE-10]]:3: error(ContentBeforeStringTerminator): only whitespace is permitted before the closing `'''` of a multi-line string // CHECK:STDERR: error here: ''' // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_block_string_second_line.carbon diff --git a/toolchain/lex/testdata/fail_mismatched_brackets.carbon b/toolchain/lex/testdata/fail_mismatched_brackets.carbon index bb926015abb96..60dd69ae8b83d 100644 --- a/toolchain/lex/testdata/fail_mismatched_brackets.carbon +++ b/toolchain/lex/testdata/fail_mismatched_brackets.carbon @@ -11,14 +11,14 @@ // CHECK:STDOUT: tokens: [ // CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }, -// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:1: error: closing symbol without a corresponding opening symbol +// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:1: error(UnmatchedClosing): closing symbol without a corresponding opening symbol // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: } // CHECK:STDOUT: { index: 1, kind: 'Error', line: {{ *}}[[@LINE-1]], column: 1, indent: 1, spelling: '}', has_leading_space: true }, -// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:3: error: closing symbol without a corresponding opening symbol +// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+4]]:3: error(UnmatchedClosing): closing symbol without a corresponding opening symbol // CHECK:STDERR: ( } ) // CHECK:STDERR: ^ // CHECK:STDERR: @@ -27,7 +27,7 @@ // CHECK:STDOUT: { index: 3, kind: 'Error', line: {{ *}}[[@LINE-2]], column: 3, indent: 1, spelling: '}', has_leading_space: true }, // CHECK:STDOUT: { index: 4, kind: 'CloseParen', line: {{ *}}[[@LINE-3]], column: 5, indent: 1, spelling: ')', opening_token: 2, has_leading_space: true }, -// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+3]]:1: error: opening symbol without a corresponding closing symbol +// CHECK:STDERR: fail_mismatched_brackets.carbon:[[@LINE+3]]:1: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: [ // CHECK:STDERR: ^ [ diff --git a/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon b/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon index a25990c7a6402..9bbb6a335d99e 100644 --- a/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon +++ b/toolchain/lex/testdata/fail_mismatched_brackets_2.carbon @@ -18,7 +18,7 @@ fn F() { // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_mismatched_brackets_2.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_mismatched_brackets_2.carbon -// CHECK:STDERR: fail_mismatched_brackets_2.carbon:[[@LINE-9]]:1: error: closing symbol without a corresponding opening symbol +// CHECK:STDERR: fail_mismatched_brackets_2.carbon:[[@LINE-9]]:1: error(UnmatchedClosing): closing symbol without a corresponding opening symbol // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_mismatched_brackets_2.carbon diff --git a/toolchain/lex/testdata/fail_multifile.carbon b/toolchain/lex/testdata/fail_multifile.carbon index aa14954282c02..5c3e3e5a6e781 100644 --- a/toolchain/lex/testdata/fail_multifile.carbon +++ b/toolchain/lex/testdata/fail_multifile.carbon @@ -12,7 +12,7 @@ // CHECK:STDOUT: - filename: fail_a.carbon // CHECK:STDOUT: tokens: [ // CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }, -// CHECK:STDERR: fail_a.carbon:[[@LINE+4]]:3: error: empty digit sequence in numeric literal +// CHECK:STDERR: fail_a.carbon:[[@LINE+4]]:3: error(EmptyDigitSequence): empty digit sequence in numeric literal // CHECK:STDERR: 1.a // CHECK:STDERR: ^ // CHECK:STDERR: @@ -25,7 +25,7 @@ // CHECK:STDOUT: - filename: fail_b.carbon // CHECK:STDOUT: tokens: [ // CHECK:STDOUT: { index: 0, kind: 'FileStart', line: {{ *\d+}}, column: 1, indent: 1, spelling: '' }, -// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:3: error: empty digit sequence in numeric literal +// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:3: error(EmptyDigitSequence): empty digit sequence in numeric literal // CHECK:STDERR: 2.b // CHECK:STDERR: ^ 2.b diff --git a/toolchain/lex/testdata/fail_trailing_comments.carbon b/toolchain/lex/testdata/fail_trailing_comments.carbon index e5a862b955073..5fcd9d12c8e23 100644 --- a/toolchain/lex/testdata/fail_trailing_comments.carbon +++ b/toolchain/lex/testdata/fail_trailing_comments.carbon @@ -16,15 +16,15 @@ var c: i32 = 0.4; // still more trailing comment // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lex/testdata/fail_trailing_comments.carbon // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lex/testdata/fail_trailing_comments.carbon -// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-11]]:19: error: trailing comments are not permitted +// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-11]]:19: error(TrailingComment): trailing comments are not permitted // CHECK:STDERR: var a: i32 = 1; // trailing comment // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-14]]:19: error: trailing comments are not permitted +// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-14]]:19: error(TrailingComment): trailing comments are not permitted // CHECK:STDERR: var b: 32 = 13; // more trailing comment // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-17]]:19: error: trailing comments are not permitted +// CHECK:STDERR: fail_trailing_comments.carbon:[[@LINE-17]]:19: error(TrailingComment): trailing comments are not permitted // CHECK:STDERR: var c: i32 = 0.4; // still more trailing comment // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_trailing_comments.carbon diff --git a/toolchain/lex/tokenized_buffer_benchmark.cpp b/toolchain/lex/tokenized_buffer_benchmark.cpp index 7e9d5099c1a6e..0c319eddc8915 100644 --- a/toolchain/lex/tokenized_buffer_benchmark.cpp +++ b/toolchain/lex/tokenized_buffer_benchmark.cpp @@ -219,7 +219,7 @@ class LexerBenchHelper { auto DiagnoseErrors() -> std::string { std::string result; llvm::raw_string_ostream out(result); - StreamDiagnosticConsumer consumer(out); + StreamDiagnosticConsumer consumer(out, /*include_diagnostic_kind=*/false); auto buffer = Lex::Lex(value_stores_, source_, consumer); consumer.Flush(); CARBON_CHECK(buffer.has_errors(), diff --git a/toolchain/lower/testdata/basics/fail_before_lowering.carbon b/toolchain/lower/testdata/basics/fail_before_lowering.carbon index ec9099c79d5d3..00cb885f387dc 100644 --- a/toolchain/lower/testdata/basics/fail_before_lowering.carbon +++ b/toolchain/lower/testdata/basics/fail_before_lowering.carbon @@ -9,11 +9,11 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/basics/fail_before_lowering.carbon -// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+7]]:1: error: unrecognized declaration introducer +// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+7]]:1: error(UnrecognizedDecl): unrecognized declaration introducer // CHECK:STDERR: a; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: error: semantics TODO: `HandleInvalidParseStart` +// CHECK:STDERR: fail_before_lowering.carbon:[[@LINE+3]]:1: error(SemanticsTodo): semantics TODO: `HandleInvalidParseStart` // CHECK:STDERR: a; // CHECK:STDERR: ^ a; diff --git a/toolchain/parse/testdata/alias/fail_syntax.carbon b/toolchain/parse/testdata/alias/fail_syntax.carbon index 9273fd07f0633..ba08f8c20e384 100644 --- a/toolchain/parse/testdata/alias/fail_syntax.carbon +++ b/toolchain/parse/testdata/alias/fail_syntax.carbon @@ -8,63 +8,63 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/alias/fail_syntax.carbon -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: error: `alias` introducer should be followed by a name +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: error(ExpectedDeclName): `alias` introducer should be followed by a name // CHECK:STDERR: alias = b; // CHECK:STDERR: ^ // CHECK:STDERR: alias = b; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: error: `alias` requires a `=` for the source +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: error(ExpectedAliasInitializer): `alias` requires a `=` for the source // CHECK:STDERR: alias a b; // CHECK:STDERR: ^ // CHECK:STDERR: alias a b; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:10: error: expected expression +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:10: error(ExpectedExpr): expected expression // CHECK:STDERR: alias a =; // CHECK:STDERR: ^ // CHECK:STDERR: alias a =; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: error: `alias` requires a `=` for the source +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: error(ExpectedAliasInitializer): `alias` requires a `=` for the source // CHECK:STDERR: alias a; // CHECK:STDERR: ^ // CHECK:STDERR: alias a; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: error: `alias` introducer should be followed by a name +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:7: error(ExpectedDeclName): `alias` introducer should be followed by a name // CHECK:STDERR: alias =; // CHECK:STDERR: ^ // CHECK:STDERR: alias =; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: error: `alias` requires a `=` for the source +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:9: error(ExpectedAliasInitializer): `alias` requires a `=` for the source // CHECK:STDERR: alias a b c = d; // CHECK:STDERR: ^ // CHECK:STDERR: alias a b c = d; -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:13: error: `alias` declarations must end with a `;` +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:13: error(ExpectedDeclSemi): `alias` declarations must end with a `;` // CHECK:STDERR: alias a = b c d; // CHECK:STDERR: ^ // CHECK:STDERR: alias a = b c d; fn F() { - // CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: error: `alias` introducer should be followed by a name + // CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:8: error(ExpectedDeclName): `alias` introducer should be followed by a name // CHECK:STDERR: alias; // CHECK:STDERR: ^ // CHECK:STDERR: alias; - // CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:12: error: expected expression + // CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:12: error(ExpectedExpr): expected expression // CHECK:STDERR: alias a =; // CHECK:STDERR: ^ // CHECK:STDERR: alias a =; alias a = -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:1: error: expected expression +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+4]]:1: error(ExpectedExpr): expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: @@ -72,7 +72,7 @@ fn F() { alias a = b -// CHECK:STDERR: fail_syntax.carbon:[[@LINE+56]]:21: error: `alias` declarations must end with a `;` +// CHECK:STDERR: fail_syntax.carbon:[[@LINE+56]]:21: error(ExpectedDeclSemi): `alias` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_syntax.carbon diff --git a/toolchain/parse/testdata/array/fail_require_close_bracket.carbon b/toolchain/parse/testdata/array/fail_require_close_bracket.carbon index d98b8aa6b031b..964d3925197f4 100644 --- a/toolchain/parse/testdata/array/fail_require_close_bracket.carbon +++ b/toolchain/parse/testdata/array/fail_require_close_bracket.carbon @@ -9,11 +9,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/array/fail_require_close_bracket.carbon // TODO: It should emit only one error message. -// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+7]]:8: error: opening symbol without a corresponding closing symbol +// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+7]]:8: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:8: error: expected expression +// CHECK:STDERR: fail_require_close_bracket.carbon:[[@LINE+3]]:8: error(ExpectedExpr): expected expression // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ var x: [i32;; diff --git a/toolchain/parse/testdata/array/fail_require_semi.carbon b/toolchain/parse/testdata/array/fail_require_semi.carbon index dfcfa306e9cea..6ff18fb45dace 100644 --- a/toolchain/parse/testdata/array/fail_require_semi.carbon +++ b/toolchain/parse/testdata/array/fail_require_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/array/fail_require_semi.carbon -// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: error: expected `;` in array type +// CHECK:STDERR: fail_require_semi.carbon:[[@LINE+3]]:12: error(ExpectedArraySemi): expected `;` in array type // CHECK:STDERR: var x: [i32]; // CHECK:STDERR: ^ var x: [i32]; diff --git a/toolchain/parse/testdata/array/fail_syntax.carbon b/toolchain/parse/testdata/array/fail_syntax.carbon index 456a9d09ea093..fc7701671a488 100644 --- a/toolchain/parse/testdata/array/fail_syntax.carbon +++ b/toolchain/parse/testdata/array/fail_syntax.carbon @@ -10,7 +10,7 @@ // --- fail_type.carbon -// CHECK:STDERR: fail_type.carbon:[[@LINE+4]]:12: error: expected `;` in array type +// CHECK:STDERR: fail_type.carbon:[[@LINE+4]]:12: error(ExpectedArraySemi): expected `;` in array type // CHECK:STDERR: var x: [i32]; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -18,19 +18,19 @@ var x: [i32]; // --- fail_invalid_char.carbon -// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+16]]:12: error: expected expression +// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+16]]:12: error(ExpectedExpr): expected expression // CHECK:STDERR: fn X() -> [:]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+12]]:12: error: expected `;` in array type +// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+12]]:12: error(ExpectedArraySemi): expected `;` in array type // CHECK:STDERR: fn X() -> [:]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+8]]:12: error: expected expression +// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+8]]:12: error(ExpectedExpr): expected expression // CHECK:STDERR: fn X() -> [:]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+4]]:12: error: unexpected tokens before `]` +// CHECK:STDERR: fail_invalid_char.carbon:[[@LINE+4]]:12: error(ExpectedCloseSymbol): unexpected tokens before `]` // CHECK:STDERR: fn X() -> [:]; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -38,23 +38,23 @@ fn X() -> [:]; // --- fail_unlexed_expr.carbon -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+20]]:9: error: encountered unrecognized characters while parsing +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+20]]:9: error(UnrecognizedCharacters): encountered unrecognized characters while parsing // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+16]]:9: error: expected expression +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+16]]:9: error(ExpectedExpr): expected expression // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+12]]:9: error: expected `;` in array type +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+12]]:9: error(ExpectedArraySemi): expected `;` in array type // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+8]]:9: error: expected expression +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+8]]:9: error(ExpectedExpr): expected expression // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+4]]:9: error: unexpected tokens before `]` +// CHECK:STDERR: fail_unlexed_expr.carbon:[[@LINE+4]]:9: error(ExpectedCloseSymbol): unexpected tokens before `]` // CHECK:STDERR: var y: [`]; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -62,11 +62,11 @@ var y: [`]; // --- fail_no_close_bracket.carbon -// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+8]]:8: error: opening symbol without a corresponding closing symbol +// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+8]]:8: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+4]]:8: error: expected expression +// CHECK:STDERR: fail_no_close_bracket.carbon:[[@LINE+4]]:8: error(ExpectedExpr): expected expression // CHECK:STDERR: var x: [i32;; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -74,7 +74,7 @@ var x: [i32;; // --- fail_no_semi.carbon -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:12: error: expected `;` in array type +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:12: error(ExpectedArraySemi): expected `;` in array type // CHECK:STDERR: var x: [i32]; // CHECK:STDERR: ^ var x: [i32]; diff --git a/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon b/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon index 1a01898f5202a..fddbf52f2f6d8 100644 --- a/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon +++ b/toolchain/parse/testdata/basics/fail_bracket_recovery.carbon @@ -10,20 +10,20 @@ // This is a valid parse tree even though the lex errors. fn F() { - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:11: error: opening symbol without a corresponding closing symbol + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+4]]:11: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: ([i32; 3) = (0, 1, 2); // CHECK:STDERR: ^ // CHECK:STDERR: var x: ([i32; 3) = (0, 1, 2); - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: error: opening symbol without a corresponding closing symbol + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+11]]:15: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: error: opening symbol without a corresponding closing symbol + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+7]]:26: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: error: opening symbol without a corresponding closing symbol + // CHECK:STDERR: fail_bracket_recovery.carbon:[[@LINE+3]]:27: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: var x: {.y: (} = {.y = ((}; // CHECK:STDERR: ^ var x: {.y: (} = {.y = ((}; diff --git a/toolchain/parse/testdata/basics/fail_invalid_designators.carbon b/toolchain/parse/testdata/basics/fail_invalid_designators.carbon index dbfda443dd489..4450d8230a59a 100644 --- a/toolchain/parse/testdata/basics/fail_invalid_designators.carbon +++ b/toolchain/parse/testdata/basics/fail_invalid_designators.carbon @@ -10,12 +10,12 @@ // NOTE: Move to its own directory when more tests are added. fn F() { - // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: error: expected identifier after `.` + // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+4]]:5: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: a.; // CHECK:STDERR: ^ // CHECK:STDERR: a.; - // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: error: expected identifier after `.` + // CHECK:STDERR: fail_invalid_designators.carbon:[[@LINE+3]]:5: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: a.fn; // CHECK:STDERR: ^~ a.fn; diff --git a/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon b/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon index 9f56e4cc74b33..c4039b6867f36 100644 --- a/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_modifiers_before_semi.carbon -// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: error: unrecognized declaration introducer +// CHECK:STDERR: fail_modifiers_before_semi.carbon:[[@LINE+3]]:18: error(UnrecognizedDecl): unrecognized declaration introducer // CHECK:STDERR: protected virtual; // CHECK:STDERR: ^ protected virtual; diff --git a/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon b/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon index 3c08b2ab8aeed..8ae04c10fe707 100644 --- a/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_with_semi.carbon -// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer +// CHECK:STDERR: fail_no_intro_with_semi.carbon:[[@LINE+3]]:1: error(UnrecognizedDecl): unrecognized declaration introducer // CHECK:STDERR: foo; // CHECK:STDERR: ^~~ foo; diff --git a/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon b/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon index 2e0d99da30192..127d56088d956 100644 --- a/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon +++ b/toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_no_intro_without_semi.carbon -// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer +// CHECK:STDERR: fail_no_intro_without_semi.carbon:[[@LINE+3]]:1: error(UnrecognizedDecl): unrecognized declaration introducer // CHECK:STDERR: foo bar baz // CHECK:STDERR: ^~~ foo bar baz diff --git a/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon b/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon index 325fae833bf3c..7a52948a9bcc1 100644 --- a/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon +++ b/toolchain/parse/testdata/basics/fail_paren_match_regression.carbon @@ -8,17 +8,17 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/basics/fail_paren_match_regression.carbon -// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+8]]:5: error: expected name in binding pattern +// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+8]]:5: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: var = (foo {}) // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+4]]:12: error: expected `,` or `)` +// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+4]]:12: error(UnexpectedTokenAfterListElement): expected `,` or `)` // CHECK:STDERR: var = (foo {}) // CHECK:STDERR: ^ // CHECK:STDERR: var = (foo {}) -// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: error: `var` declarations must end with a `;` +// CHECK:STDERR: fail_paren_match_regression.carbon:[[@LINE+16]]:21: error(ExpectedDeclSemi): `var` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_paren_match_regression.carbon diff --git a/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon b/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon index fe00fbcceb11f..565a5b5ef5467 100644 --- a/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon +++ b/toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_alternative_with_implicit_params.carbon choice X { - // CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+3]]:4: error: expected `,` or `}` + // CHECK:STDERR: fail_alternative_with_implicit_params.carbon:[[@LINE+3]]:4: error(UnexpectedTokenAfterListElement): expected `,` or `}` // CHECK:STDERR: A[T:! type](value: T) // CHECK:STDERR: ^ A[T:! type](value: T) diff --git a/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon b/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon index 5371354d22502..b538252a2dc2f 100644 --- a/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon +++ b/toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon @@ -9,12 +9,12 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_invalid_alternative_identifier.carbon choice InvalidAlternativeIdentifier { - // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+4]]:5: error: expected choice alternative name + // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+4]]:5: error(ExpectedChoiceAlternativeName): expected choice alternative name // CHECK:STDERR: ,Some, // CHECK:STDERR: ^ // CHECK:STDERR: ,Some, - // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+3]]:5: error: expected choice alternative name + // CHECK:STDERR: fail_invalid_alternative_identifier.carbon:[[@LINE+3]]:5: error(ExpectedChoiceAlternativeName): expected choice alternative name // CHECK:STDERR: 42, // CHECK:STDERR: ^~ 42, diff --git a/toolchain/parse/testdata/choice/fail_invalid_braces.carbon b/toolchain/parse/testdata/choice/fail_invalid_braces.carbon index 2d51cd8c1ba38..b0c8cfe4ccdf8 100644 --- a/toolchain/parse/testdata/choice/fail_invalid_braces.carbon +++ b/toolchain/parse/testdata/choice/fail_invalid_braces.carbon @@ -8,13 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_invalid_braces.carbon -// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+4]]:22: error: choice definition expected +// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+4]]:22: error(ExpectedChoiceDefinition): choice definition expected // CHECK:STDERR: choice InvalidBraces | // CHECK:STDERR: ^ // CHECK:STDERR: choice InvalidBraces | Some -// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer +// CHECK:STDERR: fail_invalid_braces.carbon:[[@LINE+3]]:1: error(UnrecognizedDecl): unrecognized declaration introducer // CHECK:STDERR: | // CHECK:STDERR: ^ | diff --git a/toolchain/parse/testdata/choice/fail_missing_definition.carbon b/toolchain/parse/testdata/choice/fail_missing_definition.carbon index cd440caca33d5..9ff6b70f46361 100644 --- a/toolchain/parse/testdata/choice/fail_missing_definition.carbon +++ b/toolchain/parse/testdata/choice/fail_missing_definition.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_missing_definition.carbon -// CHECK:STDERR: fail_missing_definition.carbon:[[@LINE+3]]:25: error: choice definition expected +// CHECK:STDERR: fail_missing_definition.carbon:[[@LINE+3]]:25: error(ExpectedChoiceDefinition): choice definition expected // CHECK:STDERR: choice MissingDefinition; // CHECK:STDERR: ^ choice MissingDefinition; diff --git a/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon b/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon index 05101b6797320..bc41d045eb1d9 100644 --- a/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon +++ b/toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_missing_definition_parameterized.carbon -// CHECK:STDERR: fail_missing_definition_parameterized.carbon:[[@LINE+3]]:35: error: choice definition expected +// CHECK:STDERR: fail_missing_definition_parameterized.carbon:[[@LINE+3]]:35: error(ExpectedChoiceDefinition): choice definition expected // CHECK:STDERR: choice MissingDefinition(T:! type); // CHECK:STDERR: ^ choice MissingDefinition(T:! type); diff --git a/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon b/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon index b266e787a85af..c638eae4c945a 100644 --- a/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon +++ b/toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/choice/fail_qualified_alternative_name.carbon choice X { - // CHECK:STDERR: fail_qualified_alternative_name.carbon:[[@LINE+3]]:4: error: expected `,` or `}` + // CHECK:STDERR: fail_qualified_alternative_name.carbon:[[@LINE+3]]:4: error(UnexpectedTokenAfterListElement): expected `,` or `}` // CHECK:STDERR: A.B // CHECK:STDERR: ^ A.B diff --git a/toolchain/parse/testdata/class/adapt.carbon b/toolchain/parse/testdata/class/adapt.carbon index 89714bc89d750..ad4646e1e0398 100644 --- a/toolchain/parse/testdata/class/adapt.carbon +++ b/toolchain/parse/testdata/class/adapt.carbon @@ -36,7 +36,7 @@ adapt i32; // --- fail_bad_syntax.carbon class A { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:11: error: `adapt` declarations must end with a `;` + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:11: error(ExpectedDeclSemi): `adapt` declarations must end with a `;` // CHECK:STDERR: adapt 1 trailing_token; // CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: @@ -44,7 +44,7 @@ class A { } class B { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:8: error: expected expression + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:8: error(ExpectedExpr): expected expression // CHECK:STDERR: adapt; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -53,14 +53,14 @@ class B { class C { adapt -// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:1: error: expected expression +// CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:1: error(ExpectedExpr): expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: } class D { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:9: error: expected expression + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+4]]:9: error(ExpectedExpr): expected expression // CHECK:STDERR: adapt class; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -68,7 +68,7 @@ class D { } fn F() { - // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+3]]:3: error: expected expression + // CHECK:STDERR: fail_bad_syntax.carbon:[[@LINE+3]]:3: error(ExpectedExpr): expected expression // CHECK:STDERR: adapt i32; // CHECK:STDERR: ^~~~~ adapt i32; diff --git a/toolchain/parse/testdata/class/fail_base.carbon b/toolchain/parse/testdata/class/fail_base.carbon index 9cf46f049a48a..df1a0ce7b0260 100644 --- a/toolchain/parse/testdata/class/fail_base.carbon +++ b/toolchain/parse/testdata/class/fail_base.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/class/fail_base.carbon class A { - // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:7: error: `class` or `:` expected after `base` + // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:7: error(ExpectedAfterBase): `class` or `:` expected after `base` // CHECK:STDERR: base; // CHECK:STDERR: ^ // CHECK:STDERR: base; - // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:9: error: expected expression + // CHECK:STDERR: fail_base.carbon:[[@LINE+4]]:9: error(ExpectedExpr): expected expression // CHECK:STDERR: base: ; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -23,11 +23,11 @@ class A { base: { } // We should resume parsing here after the previous error. - // CHECK:STDERR: fail_base.carbon:[[@LINE+7]]:3: error: `base` declarations must end with a `;` + // CHECK:STDERR: fail_base.carbon:[[@LINE+7]]:3: error(ExpectedDeclSemi): `base` declarations must end with a `;` // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^~~ // CHECK:STDERR: - // CHECK:STDERR: fail_base.carbon:[[@LINE+3]]:7: error: unrecognized declaration introducer + // CHECK:STDERR: fail_base.carbon:[[@LINE+3]]:7: error(UnrecognizedDecl): unrecognized declaration introducer // CHECK:STDERR: var n: i32; // CHECK:STDERR: ^ var n: i32; diff --git a/toolchain/parse/testdata/class/fail_base_misplaced.carbon b/toolchain/parse/testdata/class/fail_base_misplaced.carbon index 97e238904c53a..726c421134104 100644 --- a/toolchain/parse/testdata/class/fail_base_misplaced.carbon +++ b/toolchain/parse/testdata/class/fail_base_misplaced.carbon @@ -11,7 +11,7 @@ base class B {} fn F() { - // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error: expected expression + // CHECK:STDERR: fail_base_misplaced.carbon:[[@LINE+3]]:3: error(ExpectedExpr): expected expression // CHECK:STDERR: base: B; // CHECK:STDERR: ^~~~ base: B; diff --git a/toolchain/parse/testdata/class/fail_modifiers.carbon b/toolchain/parse/testdata/class/fail_modifiers.carbon index 3a10dc6b3e2d6..1c1851f0f8f8d 100644 --- a/toolchain/parse/testdata/class/fail_modifiers.carbon +++ b/toolchain/parse/testdata/class/fail_modifiers.carbon @@ -11,14 +11,14 @@ // --- fail_virtual_class.carbon virtual class B -// CHECK:STDERR: fail_virtual_class.carbon:[[@LINE+4]]:1: error: `virtual` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_virtual_class.carbon:[[@LINE+4]]:1: error(ExpectedDeclSemiOrDefinition): `virtual` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: // CHECK:STDERR: ^ // CHECK:STDERR: // --- fail_impl_class.carbon -// CHECK:STDERR: fail_impl_class.carbon:[[@LINE+4]]:1: error: `impl` introducer should be followed by a name +// CHECK:STDERR: fail_impl_class.carbon:[[@LINE+4]]:1: error(ExpectedDeclName): `impl` introducer should be followed by a name // CHECK:STDERR: impl class // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -27,7 +27,7 @@ impl class // --- fail_extend_adapt_base.carbon class C { - // CHECK:STDERR: fail_extend_adapt_base.carbon:[[@LINE+3]]:16: error: expected expression + // CHECK:STDERR: fail_extend_adapt_base.carbon:[[@LINE+3]]:16: error(ExpectedExpr): expected expression // CHECK:STDERR: extend adapt base B; // CHECK:STDERR: ^~~~ extend adapt base B; diff --git a/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon b/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon index 3ea688082e470..3a13f59d57ed8 100644 --- a/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon +++ b/toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_colon_instead_of_in.carbon fn foo() { - // CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: error: `:` should be replaced by `in` + // CHECK:STDERR: fail_colon_instead_of_in.carbon:[[@LINE+3]]:19: error(ExpectedInNotColon): `:` should be replaced by `in` // CHECK:STDERR: for (var x: i32 : y) { // CHECK:STDERR: ^ for (var x: i32 : y) { diff --git a/toolchain/parse/testdata/for/fail_missing_cond.carbon b/toolchain/parse/testdata/for/fail_missing_cond.carbon index 590a7eeb105ac..a5cd2c1e33fea 100644 --- a/toolchain/parse/testdata/for/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/for/fail_missing_cond.carbon @@ -9,21 +9,21 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_cond.carbon fn F() { - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+8]]:7: error: expected `(` after `for` + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+8]]:7: error(ExpectedParenAfter): expected `(` after `for` // CHECK:STDERR: for { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:7: error: expected `var` declaration + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+4]]:7: error(ExpectedVariableDecl): expected `var` declaration // CHECK:STDERR: for { // CHECK:STDERR: ^ // CHECK:STDERR: for { } -// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+7]]:1: error: expected braced code block +// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+7]]:1: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: error: expected expression +// CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:1: error(ExpectedExpr): expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/for/fail_missing_in.carbon b/toolchain/parse/testdata/for/fail_missing_in.carbon index 7865876d1242d..f52a175cbcb20 100644 --- a/toolchain/parse/testdata/for/fail_missing_in.carbon +++ b/toolchain/parse/testdata/for/fail_missing_in.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_in.carbon fn foo() { - // CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: error: expected `in` after loop `var` declaration + // CHECK:STDERR: fail_missing_in.carbon:[[@LINE+3]]:19: error(ExpectedIn): expected `in` after loop `var` declaration // CHECK:STDERR: for (var x: i32 y) { // CHECK:STDERR: ^ for (var x: i32 y) { diff --git a/toolchain/parse/testdata/for/fail_missing_var.carbon b/toolchain/parse/testdata/for/fail_missing_var.carbon index 69379f2c81679..962cbb104634b 100644 --- a/toolchain/parse/testdata/for/fail_missing_var.carbon +++ b/toolchain/parse/testdata/for/fail_missing_var.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_missing_var.carbon fn foo() { - // CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: error: expected `var` declaration + // CHECK:STDERR: fail_missing_var.carbon:[[@LINE+3]]:8: error(ExpectedVariableDecl): expected `var` declaration // CHECK:STDERR: for (x: i32 in y) { // CHECK:STDERR: ^ for (x: i32 in y) { diff --git a/toolchain/parse/testdata/for/fail_returned_var.carbon b/toolchain/parse/testdata/for/fail_returned_var.carbon index 143f19178f710..f3319c5433607 100644 --- a/toolchain/parse/testdata/for/fail_returned_var.carbon +++ b/toolchain/parse/testdata/for/fail_returned_var.carbon @@ -10,7 +10,7 @@ fn foo() -> i32 { // TODO: Should we allow this? - // CHECK:STDERR: fail_returned_var.carbon:[[@LINE+3]]:8: error: expected `var` declaration + // CHECK:STDERR: fail_returned_var.carbon:[[@LINE+3]]:8: error(ExpectedVariableDecl): expected `var` declaration // CHECK:STDERR: for (returned var x: i32 in y) { // CHECK:STDERR: ^~~~~~~~ for (returned var x: i32 in y) { diff --git a/toolchain/parse/testdata/for/fail_square_brackets.carbon b/toolchain/parse/testdata/for/fail_square_brackets.carbon index 30f89312e829c..0d443d3234872 100644 --- a/toolchain/parse/testdata/for/fail_square_brackets.carbon +++ b/toolchain/parse/testdata/for/fail_square_brackets.carbon @@ -9,19 +9,19 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/for/fail_square_brackets.carbon fn F() { - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+15]]:7: error: expected `(` after `for` + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+15]]:7: error(ExpectedParenAfter): expected `(` after `for` // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:7: error: expected `var` declaration + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:7: error(ExpectedVariableDecl): expected `var` declaration // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:8: error: expected expression + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:8: error(ExpectedExpr): expected expression // CHECK:STDERR: for [] { // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: error: expected `;` in array type + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:8: error(ExpectedArraySemi): expected `;` in array type // CHECK:STDERR: for [] { // CHECK:STDERR: ^ for [] { diff --git a/toolchain/parse/testdata/function/declaration/extern.carbon b/toolchain/parse/testdata/function/declaration/extern.carbon index a2ca9892a22d4..d0487de0fee40 100644 --- a/toolchain/parse/testdata/function/declaration/extern.carbon +++ b/toolchain/parse/testdata/function/declaration/extern.carbon @@ -22,7 +22,7 @@ extern library default fn G(); // --- fail_name_missing.carbon -// CHECK:STDERR: fail_name_missing.carbon:[[@LINE+4]]:16: error: expected `default` or a string literal to specify the library name +// CHECK:STDERR: fail_name_missing.carbon:[[@LINE+4]]:16: error(ExpectedLibraryNameOrDefault): expected `default` or a string literal to specify the library name // CHECK:STDERR: extern library fn G(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -30,11 +30,11 @@ extern library fn G(); // --- fail_identifier.carbon -// CHECK:STDERR: fail_identifier.carbon:[[@LINE+7]]:16: error: expected `default` or a string literal to specify the library name +// CHECK:STDERR: fail_identifier.carbon:[[@LINE+7]]:16: error(ExpectedLibraryNameOrDefault): expected `default` or a string literal to specify the library name // CHECK:STDERR: extern library foo fn G(); // CHECK:STDERR: ^~~ // CHECK:STDERR: -// CHECK:STDERR: fail_identifier.carbon:[[@LINE+3]]:16: error: unrecognized declaration introducer +// CHECK:STDERR: fail_identifier.carbon:[[@LINE+3]]:16: error(UnrecognizedDecl): unrecognized declaration introducer // CHECK:STDERR: extern library foo fn G(); // CHECK:STDERR: ^~~ extern library foo fn G(); diff --git a/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon b/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon index b8f7f922f3ef7..4fce0a0d357a6 100644 --- a/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_identifier_instead_of_sig.carbon -// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_identifier_instead_of_sig.carbon:[[@LINE+3]]:8: error(ExpectedDeclSemiOrDefinition): `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: fn foo bar; // CHECK:STDERR: ^~~ fn foo bar; diff --git a/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon b/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon index 441965b45ae3d..9813e3b2c610b 100644 --- a/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon @@ -9,11 +9,11 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_implicit_close.carbon // Fix and uncomment this to test error handling. -// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+7]]:7: error: opening symbol without a corresponding closing symbol +// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+7]]:7: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: fn Div[(); // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+3]]:7: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_missing_implicit_close.carbon:[[@LINE+3]]:7: error(ExpectedDeclSemiOrDefinition): `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: fn Div[(); // CHECK:STDERR: ^ fn Div[(); diff --git a/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon b/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon index c5eba8612b7ae..8831ea507a3a8 100644 --- a/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_missing_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_missing_name.carbon -// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name +// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:4: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn (); // CHECK:STDERR: ^ fn (); diff --git a/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon index a1c56e3eebf97..2d24a73681db8 100644 --- a/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_no_sig_or_semi.carbon @@ -10,7 +10,7 @@ fn foo -// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+10]]:21: error: `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_no_sig_or_semi.carbon:[[@LINE+10]]:21: error(ExpectedDeclSemiOrDefinition): `fn` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_sig_or_semi.carbon diff --git a/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon index 1e7edd33a4183..672f69a700e13 100644 --- a/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_only_fn_and_semi.carbon -// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: error: `fn` introducer should be followed by a name +// CHECK:STDERR: fail_only_fn_and_semi.carbon:[[@LINE+3]]:3: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn; // CHECK:STDERR: ^ fn; diff --git a/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon index f316cd2e92199..71f8e867d3ee2 100644 --- a/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_repeated_fn_and_semi.carbon -// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name +// CHECK:STDERR: fail_repeated_fn_and_semi.carbon:[[@LINE+3]]:4: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn fn; // CHECK:STDERR: ^~ fn fn; diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon index 8ecdaad6123c7..a6c4961e7d9ca 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_until_outdent.carbon - // CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: error: `fn` introducer should be followed by a name + // CHECK:STDERR: fail_skip_indented_newline_until_outdent.carbon:[[@LINE+3]]:6: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ fn (x, diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon index 8c1bc943ba0ff..a0e9c3a186112 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_with_semi.carbon -// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name +// CHECK:STDERR: fail_skip_indented_newline_with_semi.carbon:[[@LINE+3]]:4: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ fn (x, diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon index 67f9fda454d93..572a74c38cd53 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_indented_newline_without_semi.carbon -// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name +// CHECK:STDERR: fail_skip_indented_newline_without_semi.carbon:[[@LINE+3]]:4: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn (x, // CHECK:STDERR: ^ fn (x, diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon index 6b0afe63f12fe..7506a42a013d5 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_to_newline_without_semi.carbon -// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name +// CHECK:STDERR: fail_skip_to_newline_without_semi.carbon:[[@LINE+3]]:4: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn () // CHECK:STDERR: ^ fn () diff --git a/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon b/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon index 9b37c23bcd34a..e2c7f9a561a02 100644 --- a/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_skip_without_semi_to_curly.carbon -// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: error: unrecognized declaration introducer +// CHECK:STDERR: fail_skip_without_semi_to_curly.carbon:[[@LINE+3]]:1: error(UnrecognizedDecl): unrecognized declaration introducer // CHECK:STDERR: struct X { fn () } // CHECK:STDERR: ^~~~~~ struct X { fn () } diff --git a/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon b/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon index b06a1a56ec9cb..34db6b1b960bf 100644 --- a/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_with_identifier_as_param.carbon -// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: error: expected `:` or `:!` in binding pattern +// CHECK:STDERR: fail_with_identifier_as_param.carbon:[[@LINE+3]]:11: error(ExpectedBindingPattern): expected `:` or `:!` in binding pattern // CHECK:STDERR: fn foo(bar); // CHECK:STDERR: ^ fn foo(bar); diff --git a/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon b/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon index 8329e737e43b0..e966c7f7a9eee 100644 --- a/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon +++ b/toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/declaration/fail_without_name_and_many_tokens_in_params.carbon -// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: error: `fn` introducer should be followed by a name +// CHECK:STDERR: fail_without_name_and_many_tokens_in_params.carbon:[[@LINE+3]]:4: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z); // CHECK:STDERR: ^ fn (a tokens c d e f g h i j k l m n o p q r s t u v w x y z); diff --git a/toolchain/parse/testdata/function/definition/fail_builtin.carbon b/toolchain/parse/testdata/function/definition/fail_builtin.carbon index 8e26d047628bd..19d66a8f8266d 100644 --- a/toolchain/parse/testdata/function/definition/fail_builtin.carbon +++ b/toolchain/parse/testdata/function/definition/fail_builtin.carbon @@ -8,18 +8,18 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/function/definition/fail_builtin.carbon -// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:18: error: expected builtin function name after `=` +// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:18: error(ExpectedBuiltinName): expected builtin function name after `=` // CHECK:STDERR: fn NotString() = banana; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: fn NotString() = banana; -// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:32: error: `fn` declarations must end with a `;` +// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:32: error(ExpectedDeclSemi): `fn` declarations must end with a `;` // CHECK:STDERR: fn JunkAfterString() = "hello" "world"; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: fn JunkAfterString() = "hello" "world"; -// CHECK:STDERR: fail_builtin.carbon:[[@LINE+3]]:23: error: expected builtin function name after `=` +// CHECK:STDERR: fail_builtin.carbon:[[@LINE+3]]:23: error(ExpectedBuiltinName): expected builtin function name after `=` // CHECK:STDERR: fn SpuriousEquals() = { } // CHECK:STDERR: ^ fn SpuriousEquals() = { } diff --git a/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon b/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon index 2f19aa29ea801..ad9ba7cdda74f 100644 --- a/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon +++ b/toolchain/parse/testdata/function/definition/fail_identifier_in_statements.carbon @@ -12,7 +12,7 @@ fn F() { // Note: this might become valid depending on the expression syntax. This test // shouldn't be taken as a sign it should remain invalid. bar -// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: error: expected `;` after expression statement +// CHECK:STDERR: fail_identifier_in_statements.carbon:[[@LINE+3]]:1: error(ExpectedExprSemi): expected `;` after expression statement // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon b/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon index 68d17e4f4f34d..93350be88565d 100644 --- a/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon +++ b/toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon @@ -8,25 +8,25 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/deduced_params/fail_no_parens.carbon -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:12: error: a `(` for parameters is required after implicit parameters +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:12: error(ParamsRequiredAfterImplicit): a `(` for parameters is required after implicit parameters // CHECK:STDERR: class Foo[]; // CHECK:STDERR: ^ // CHECK:STDERR: class Foo[]; -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:18: error: a `(` for parameters is required after implicit parameters +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:18: error(ParamsRequiredAfterImplicit): a `(` for parameters is required after implicit parameters // CHECK:STDERR: class Foo[a: i32]; // CHECK:STDERR: ^ // CHECK:STDERR: class Foo[a: i32]; -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:17: error: a `(` for parameters is required after implicit parameters +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+4]]:17: error(ParamsRequiredAfterImplicit): a `(` for parameters is required after implicit parameters // CHECK:STDERR: interface Bar[] {} // CHECK:STDERR: ^ // CHECK:STDERR: interface Bar[] {} -// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+3]]:23: error: a `(` for parameters is required after implicit parameters +// CHECK:STDERR: fail_no_parens.carbon:[[@LINE+3]]:23: error(ParamsRequiredAfterImplicit): a `(` for parameters is required after implicit parameters // CHECK:STDERR: interface Bar[a: i32] {} // CHECK:STDERR: ^ interface Bar[a: i32] {} diff --git a/toolchain/parse/testdata/generics/impl/fail_impl.carbon b/toolchain/parse/testdata/generics/impl/fail_impl.carbon index cd59f5a709643..2fa5c761bddf4 100644 --- a/toolchain/parse/testdata/generics/impl/fail_impl.carbon +++ b/toolchain/parse/testdata/generics/impl/fail_impl.carbon @@ -8,87 +8,87 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/impl/fail_impl.carbon -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:10: error: expected `as` in `impl` declaration +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:10: error(ImplExpectedAs): expected `as` in `impl` declaration // CHECK:STDERR: impl foo bar; // CHECK:STDERR: ^~~ // CHECK:STDERR: impl foo bar; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:12: error: expected expression +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:12: error(ExpectedExpr): expected expression // CHECK:STDERR: impl i32 as; // CHECK:STDERR: ^ // CHECK:STDERR: impl i32 as; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:18: error: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:18: error(ExpectedDeclSemiOrDefinition): `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: impl bool as bar unexpected; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: impl bool as bar unexpected; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: error: expected expression +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: error(ExpectedExpr): expected expression // CHECK:STDERR: impl return as A; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: impl return as A; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: error: expected expression +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:6: error(ExpectedExpr): expected expression // CHECK:STDERR: impl return B; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: impl return B; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:13: error: expected `[` after `forall` in `impl` declaration +// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:13: error(ImplExpectedAfterForall): expected `[` after `forall` in `impl` declaration // CHECK:STDERR: impl forall f32; // CHECK:STDERR: ^~~ // CHECK:STDERR: -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:16: error: expected `as` in `impl` declaration +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:16: error(ImplExpectedAs): expected `as` in `impl` declaration // CHECK:STDERR: impl forall f32; // CHECK:STDERR: ^ // CHECK:STDERR: impl forall f32; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:19: error: expected `as` in `impl` declaration +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:19: error(ImplExpectedAs): expected `as` in `impl` declaration // CHECK:STDERR: impl forall [] u32; // CHECK:STDERR: ^ // CHECK:STDERR: impl forall [] u32; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:21: error: expected `:` or `:!` in binding pattern +// CHECK:STDERR: fail_impl.carbon:[[@LINE+8]]:21: error(ExpectedBindingPattern): expected `:` or `:!` in binding pattern // CHECK:STDERR: impl forall [invalid] i8; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:25: error: expected `as` in `impl` declaration +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:25: error(ImplExpectedAs): expected `as` in `impl` declaration // CHECK:STDERR: impl forall [invalid] i8; // CHECK:STDERR: ^ // CHECK:STDERR: impl forall [invalid] i8; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:13: error: expected `[` after `forall` in `impl` declaration +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:13: error(ImplExpectedAfterForall): expected `[` after `forall` in `impl` declaration // CHECK:STDERR: impl forall f16 as Quux; // CHECK:STDERR: ^~~ // CHECK:STDERR: impl forall f16 as Quux; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:30: error: expected `as` in `impl` declaration +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:30: error(ImplExpectedAs): expected `as` in `impl` declaration // CHECK:STDERR: impl forall [T:! type] String; // CHECK:STDERR: ^ // CHECK:STDERR: impl forall [T:! type] String; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:26: error: expected `as` in `impl` declaration +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:26: error(ImplExpectedAs): expected `as` in `impl` declaration // CHECK:STDERR: impl forall [T:! type] T missing_as; // CHECK:STDERR: ^~~~~~~~~~ // CHECK:STDERR: impl forall [T:! type] T missing_as; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:39: error: `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:39: error(ExpectedDeclSemiOrDefinition): `impl` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: impl forall [T:! type] T as Interface extra; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: impl forall [T:! type] T as Interface extra; -// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:5: error: expected expression +// CHECK:STDERR: fail_impl.carbon:[[@LINE+4]]:5: error(ExpectedExpr): expected expression // CHECK:STDERR: impl; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -96,7 +96,7 @@ impl; impl -// CHECK:STDERR: fail_impl.carbon:[[@LINE+88]]:21: error: expected expression +// CHECK:STDERR: fail_impl.carbon:[[@LINE+88]]:21: error(ExpectedExpr): expected expression // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_impl.carbon diff --git a/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon b/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon index b99cb079f9d2f..a3218c5274ac3 100644 --- a/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon +++ b/toolchain/parse/testdata/generics/impl/fail_out_of_line_member.carbon @@ -18,7 +18,7 @@ impl bool as Interface { fn F(); } -// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+4]]:4: error: `fn` introducer should be followed by a name +// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+4]]:4: error(ExpectedDeclName): `fn` introducer should be followed by a name // CHECK:STDERR: fn (bool as Interface).F() {} // CHECK:STDERR: ^ // CHECK:STDERR: @@ -30,7 +30,7 @@ class C { } } -// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+3]]:6: error: `.` should be followed by a name +// CHECK:STDERR: fail_out_of_line_member.carbon:[[@LINE+3]]:6: error(ExpectedDeclNameAfterPeriod): `.` should be followed by a name // CHECK:STDERR: fn C.(Self as Interface).F() {} // CHECK:STDERR: ^ fn C.(Self as Interface).F() {} diff --git a/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon b/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon index 5c8fb21688226..8ff442a66e078 100644 --- a/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_missing_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_missing_name.carbon -// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:11: error: `interface` introducer should be followed by a name +// CHECK:STDERR: fail_missing_name.carbon:[[@LINE+3]]:11: error(ExpectedDeclName): `interface` introducer should be followed by a name // CHECK:STDERR: interface { // CHECK:STDERR: ^ interface { diff --git a/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon b/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon index 8263cd392cd60..6cdc606b86a41 100644 --- a/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_missing_open_curly.carbon -// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+4]]:15: error: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+4]]:15: error(ExpectedDeclSemiOrDefinition): `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: interface Bar Baz {} // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -16,7 +16,7 @@ interface Bar Baz {} interface Foo -// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+13]]:21: error: `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_missing_open_curly.carbon:[[@LINE+13]]:21: error(ExpectedDeclSemiOrDefinition): `interface` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_missing_open_curly.carbon diff --git a/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon b/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon index fac843fb1154e..41b1387900811 100644 --- a/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon +++ b/toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon @@ -9,13 +9,13 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/interface/fail_self_param_syntax.carbon interface Foo { - // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+4]]:13: error: expected `:` or `:!` in binding pattern + // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+4]]:13: error(ExpectedBindingPattern): expected `:` or `:!` in binding pattern // CHECK:STDERR: fn Sub[me Self](b: Self) -> Self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: fn Sub[me Self](b: Self) -> Self; - // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+3]]:10: error: expected name in binding pattern + // CHECK:STDERR: fail_self_param_syntax.carbon:[[@LINE+3]]:10: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: fn Mul[Self](b: Self) -> Self; // CHECK:STDERR: ^~~~ fn Mul[Self](b: Self) -> Self; diff --git a/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon b/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon index 714302410311b..3419e300b250f 100644 --- a/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon +++ b/toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon @@ -8,13 +8,13 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/generics/named_constraint/fail_incomplete.carbon -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:12: error: `constraint` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:12: error(ExpectedDeclName): `constraint` introducer should be followed by a name // CHECK:STDERR: constraint "Foo" // CHECK:STDERR: ^~~~~ // CHECK:STDERR: constraint "Foo" -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error: `constraint` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error(ExpectedDeclName): `constraint` introducer should be followed by a name // CHECK:STDERR: constraint // CHECK:STDERR: ^~~~~~~~~~ constraint diff --git a/toolchain/parse/testdata/if/fail_else_unbraced.carbon b/toolchain/parse/testdata/if/fail_else_unbraced.carbon index 8ae2b14dcf5ad..b2012319485e5 100644 --- a/toolchain/parse/testdata/if/fail_else_unbraced.carbon +++ b/toolchain/parse/testdata/if/fail_else_unbraced.carbon @@ -10,24 +10,24 @@ fn F() { if (a) - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:5: error: expected braced code block + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:5: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: if (b) // CHECK:STDERR: ^~ // CHECK:STDERR: if (b) - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: c; // CHECK:STDERR: ^ // CHECK:STDERR: c; else - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+4]]:7: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: d; // CHECK:STDERR: ^ // CHECK:STDERR: d; else - // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+3]]:5: error: expected braced code block + // CHECK:STDERR: fail_else_unbraced.carbon:[[@LINE+3]]:5: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: e; // CHECK:STDERR: ^ e; diff --git a/toolchain/parse/testdata/if/fail_errors.carbon b/toolchain/parse/testdata/if/fail_errors.carbon index c059b9409efb0..c044e7a7f7b52 100644 --- a/toolchain/parse/testdata/if/fail_errors.carbon +++ b/toolchain/parse/testdata/if/fail_errors.carbon @@ -9,27 +9,27 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_errors.carbon fn F() { - // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:6: error: expected `(` after `if` + // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:6: error(ExpectedParenAfter): expected `(` after `if` // CHECK:STDERR: if a {} // CHECK:STDERR: ^ // CHECK:STDERR: if a {} - // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:7: error: expected expression + // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:7: error(ExpectedExpr): expected expression // CHECK:STDERR: if () {} // CHECK:STDERR: ^ // CHECK:STDERR: if () {} - // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:9: error: unexpected tokens before `)` + // CHECK:STDERR: fail_errors.carbon:[[@LINE+4]]:9: error(ExpectedCloseSymbol): unexpected tokens before `)` // CHECK:STDERR: if (b c) {} // CHECK:STDERR: ^ // CHECK:STDERR: if (b c) {} if (d) -// CHECK:STDERR: fail_errors.carbon:[[@LINE+7]]:1: error: expected braced code block +// CHECK:STDERR: fail_errors.carbon:[[@LINE+7]]:1: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_errors.carbon:[[@LINE+3]]:1: error: expected expression +// CHECK:STDERR: fail_errors.carbon:[[@LINE+3]]:1: error(ExpectedExpr): expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/if/fail_missing_cond.carbon b/toolchain/parse/testdata/if/fail_missing_cond.carbon index 964e29aa13bdc..23c3ba5c2989b 100644 --- a/toolchain/parse/testdata/if/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/if/fail_missing_cond.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_missing_cond.carbon fn F() { - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:6: error: expected `(` after `if` + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:6: error(ExpectedParenAfter): expected `(` after `if` // CHECK:STDERR: if { // CHECK:STDERR: ^ if { diff --git a/toolchain/parse/testdata/if/fail_square_brackets.carbon b/toolchain/parse/testdata/if/fail_square_brackets.carbon index b9ee1fb087919..a145ca8b87cd3 100644 --- a/toolchain/parse/testdata/if/fail_square_brackets.carbon +++ b/toolchain/parse/testdata/if/fail_square_brackets.carbon @@ -9,15 +9,15 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if/fail_square_brackets.carbon fn F() { - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:6: error: expected `(` after `if` + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+11]]:6: error(ExpectedParenAfter): expected `(` after `if` // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:7: error: expected expression + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+7]]:7: error(ExpectedExpr): expected expression // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:7: error: expected `;` in array type + // CHECK:STDERR: fail_square_brackets.carbon:[[@LINE+3]]:7: error(ExpectedArraySemi): expected `;` in array type // CHECK:STDERR: if [] {} // CHECK:STDERR: ^ if [] {} diff --git a/toolchain/parse/testdata/if/fail_unbraced.carbon b/toolchain/parse/testdata/if/fail_unbraced.carbon index 4ce3f345ffa95..3a0af76150422 100644 --- a/toolchain/parse/testdata/if/fail_unbraced.carbon +++ b/toolchain/parse/testdata/if/fail_unbraced.carbon @@ -11,17 +11,17 @@ fn F() { if (a) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:5: error: expected braced code block + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:5: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: if (b) // CHECK:STDERR: ^~ // CHECK:STDERR: if (b) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:7: error: expected braced code block + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+4]]:7: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: if (c) // CHECK:STDERR: ^~ // CHECK:STDERR: if (c) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:9: error: expected braced code block + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:9: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: d; // CHECK:STDERR: ^ d; diff --git a/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon b/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon index 6a5372762d95f..079e42fc22e0e 100644 --- a/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_condition_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_condition_missing.carbon fn F() { - // CHECK:STDERR: fail_condition_missing.carbon:[[@LINE+3]]:18: error: expected expression + // CHECK:STDERR: fail_condition_missing.carbon:[[@LINE+3]]:18: error(ExpectedExpr): expected expression // CHECK:STDERR: var n: i32 = if; // CHECK:STDERR: ^ var n: i32 = if; diff --git a/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon b/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon index 7229486e1a7bf..7474fd31d4b55 100644 --- a/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_else_expr_missing.carbon fn F() { - // CHECK:STDERR: fail_else_expr_missing.carbon:[[@LINE+3]]:35: error: expected expression + // CHECK:STDERR: fail_else_expr_missing.carbon:[[@LINE+3]]:35: error(ExpectedExpr): expected expression // CHECK:STDERR: var n: i32 = if true then 1 else; // CHECK:STDERR: ^ var n: i32 = if true then 1 else; diff --git a/toolchain/parse/testdata/if_expr/fail_else_missing.carbon b/toolchain/parse/testdata/if_expr/fail_else_missing.carbon index 34d30296aeea9..5b3b3ff63a657 100644 --- a/toolchain/parse/testdata/if_expr/fail_else_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_else_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_else_missing.carbon fn F() { - // CHECK:STDERR: fail_else_missing.carbon:[[@LINE+3]]:30: error: expected `else` after `if ... then ...` + // CHECK:STDERR: fail_else_missing.carbon:[[@LINE+3]]:30: error(ExpectedElseAfterIf): expected `else` after `if ... then ...` // CHECK:STDERR: var n: i32 = if true then 1; // CHECK:STDERR: ^ var n: i32 = if true then 1; diff --git a/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon b/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon index 6eeccdc9f35f3..209047052b8ce 100644 --- a/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_then_expr_missing.carbon fn F() { - // CHECK:STDERR: fail_then_expr_missing.carbon:[[@LINE+3]]:28: error: expected expression + // CHECK:STDERR: fail_then_expr_missing.carbon:[[@LINE+3]]:28: error(ExpectedExpr): expected expression // CHECK:STDERR: var n: i32 = if true then; // CHECK:STDERR: ^ var n: i32 = if true then; diff --git a/toolchain/parse/testdata/if_expr/fail_then_missing.carbon b/toolchain/parse/testdata/if_expr/fail_then_missing.carbon index fb10a8e3d4765..b747dbfd71aed 100644 --- a/toolchain/parse/testdata/if_expr/fail_then_missing.carbon +++ b/toolchain/parse/testdata/if_expr/fail_then_missing.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_then_missing.carbon fn F() { - // CHECK:STDERR: fail_then_missing.carbon:[[@LINE+3]]:23: error: expected `then` after `if` condition + // CHECK:STDERR: fail_then_missing.carbon:[[@LINE+3]]:23: error(ExpectedThenAfterIf): expected `then` after `if` condition // CHECK:STDERR: var n: i32 = if true; // CHECK:STDERR: ^ var n: i32 = if true; diff --git a/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon b/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon index 026597de02bbc..5dcc0304343d6 100644 --- a/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon +++ b/toolchain/parse/testdata/if_expr/fail_top_level_if.carbon @@ -9,15 +9,15 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/if_expr/fail_top_level_if.carbon fn F() { - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+11]]:6: error: expected `(` after `if` + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+11]]:6: error(ExpectedParenAfter): expected `(` after `if` // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+7]]:11: error: expected braced code block + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+7]]:11: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+3]]:11: error: expected expression + // CHECK:STDERR: fail_top_level_if.carbon:[[@LINE+3]]:11: error(ExpectedExpr): expected expression // CHECK:STDERR: if true then 1 else 2; // CHECK:STDERR: ^~~~ if true then 1 else 2; diff --git a/toolchain/parse/testdata/index/fail_empty_expr.carbon b/toolchain/parse/testdata/index/fail_empty_expr.carbon index 2655bba396794..a822d8fd161cc 100644 --- a/toolchain/parse/testdata/index/fail_empty_expr.carbon +++ b/toolchain/parse/testdata/index/fail_empty_expr.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/index/fail_empty_expr.carbon -// CHECK:STDERR: fail_empty_expr.carbon:[[@LINE+3]]:16: error: expected expression +// CHECK:STDERR: fail_empty_expr.carbon:[[@LINE+3]]:16: error(ExpectedExpr): expected expression // CHECK:STDERR: var v: i32 = t[]; // CHECK:STDERR: ^ var v: i32 = t[]; diff --git a/toolchain/parse/testdata/index/fail_malformed_expr.carbon b/toolchain/parse/testdata/index/fail_malformed_expr.carbon index 420e10fff0e5c..d75679ef4719d 100644 --- a/toolchain/parse/testdata/index/fail_malformed_expr.carbon +++ b/toolchain/parse/testdata/index/fail_malformed_expr.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/index/fail_malformed_expr.carbon -// CHECK:STDERR: fail_malformed_expr.carbon:[[@LINE+3]]:17: error: unexpected tokens before `]` +// CHECK:STDERR: fail_malformed_expr.carbon:[[@LINE+3]]:17: error(ExpectedCloseSymbol): unexpected tokens before `]` // CHECK:STDERR: var v: i32 = t[0,]; // CHECK:STDERR: ^ var v: i32 = t[0,]; diff --git a/toolchain/parse/testdata/let/fail_bad_name.carbon b/toolchain/parse/testdata/let/fail_bad_name.carbon index 832b802bb706e..f692e94e43e2a 100644 --- a/toolchain/parse/testdata/let/fail_bad_name.carbon +++ b/toolchain/parse/testdata/let/fail_bad_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_bad_name.carbon -// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error: expected name in binding pattern +// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: let ? = 4; // CHECK:STDERR: ^ let ? = 4; diff --git a/toolchain/parse/testdata/let/fail_empty.carbon b/toolchain/parse/testdata/let/fail_empty.carbon index 62fd6c334ee0c..21d0ac978c8ee 100644 --- a/toolchain/parse/testdata/let/fail_empty.carbon +++ b/toolchain/parse/testdata/let/fail_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_empty.carbon -// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error: expected name in binding pattern +// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: let; // CHECK:STDERR: ^ let; diff --git a/toolchain/parse/testdata/let/fail_missing_name.carbon b/toolchain/parse/testdata/let/fail_missing_name.carbon index 4f5e1ffd65d3c..dc8aa00c88f14 100644 --- a/toolchain/parse/testdata/let/fail_missing_name.carbon +++ b/toolchain/parse/testdata/let/fail_missing_name.carbon @@ -10,7 +10,7 @@ // --- fail_runtime_binding.carbon -// CHECK:STDERR: fail_runtime_binding.carbon:[[@LINE+4]]:5: error: expected name in binding pattern +// CHECK:STDERR: fail_runtime_binding.carbon:[[@LINE+4]]:5: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: let : i32 = 4; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -18,7 +18,7 @@ let : i32 = 4; // --- fail_complietime_binding.carbon -// CHECK:STDERR: fail_complietime_binding.carbon:[[@LINE+3]]:5: error: expected name in binding pattern +// CHECK:STDERR: fail_complietime_binding.carbon:[[@LINE+3]]:5: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: let :! bool = true; // CHECK:STDERR: ^~ let :! bool = true; diff --git a/toolchain/parse/testdata/let/fail_missing_type.carbon b/toolchain/parse/testdata/let/fail_missing_type.carbon index cfee20a9518ef..e0b5717fda473 100644 --- a/toolchain/parse/testdata/let/fail_missing_type.carbon +++ b/toolchain/parse/testdata/let/fail_missing_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/let/fail_missing_type.carbon -// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:7: error: expected `:` or `:!` in binding pattern +// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:7: error(ExpectedBindingPattern): expected `:` or `:!` in binding pattern // CHECK:STDERR: let a = 4; // CHECK:STDERR: ^ let a = 4; diff --git a/toolchain/parse/testdata/let/fail_no_semi.carbon b/toolchain/parse/testdata/let/fail_no_semi.carbon index 1e31d901465b6..243d7aba7da52 100644 --- a/toolchain/parse/testdata/let/fail_no_semi.carbon +++ b/toolchain/parse/testdata/let/fail_no_semi.carbon @@ -10,11 +10,11 @@ let -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error: expected name in binding pattern +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error: `let` declarations must end with a `;` +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error(ExpectedDeclSemi): `let` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/match/fail_cases_after_default.carbon b/toolchain/parse/testdata/match/fail_cases_after_default.carbon index 048b15fedf9d0..943b9db1abc94 100644 --- a/toolchain/parse/testdata/match/fail_cases_after_default.carbon +++ b/toolchain/parse/testdata/match/fail_cases_after_default.carbon @@ -12,17 +12,17 @@ fn f() -> i32 { var x: i32 = 3; match (x) { default => { return 1; } - // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error: unreachable case; `case` occurs after the `default` + // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error(UnreachableMatchCase): unreachable case; `case` occurs after the `default` // CHECK:STDERR: case a: i32 => { return 2; } // CHECK:STDERR: ^~~~ // CHECK:STDERR: case a: i32 => { return 2; } - // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error: unreachable case; `default` occurs after the `default` + // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+4]]:5: error(UnreachableMatchCase): unreachable case; `default` occurs after the `default` // CHECK:STDERR: default => { return 3; } // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: default => { return 3; } - // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+3]]:5: error: unreachable case; `case` occurs after the `default` + // CHECK:STDERR: fail_cases_after_default.carbon:[[@LINE+3]]:5: error(UnreachableMatchCase): unreachable case; `case` occurs after the `default` // CHECK:STDERR: case (a: i32) if (a == 4) => { return 4; } // CHECK:STDERR: ^~~~ case (a: i32) if (a == 4) => { return 4; } diff --git a/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon b/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon index dcb87bb6e56d5..3d5206e711be0 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_arrow.carbon @@ -10,12 +10,12 @@ fn f() -> i32 { match (3) { - // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+4]]:17: error: expected `=>` introducing statement block + // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+4]]:17: error(ExpectedMatchCaseArrow): expected `=>` introducing statement block // CHECK:STDERR: case x: i32 { return 2; } // CHECK:STDERR: ^ // CHECK:STDERR: case x: i32 { return 2; } - // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+3]]:29: error: expected `=>` introducing statement block + // CHECK:STDERR: fail_missing_case_arrow.carbon:[[@LINE+3]]:29: error(ExpectedMatchCaseArrow): expected `=>` introducing statement block // CHECK:STDERR: case x: i32 if (x == 3) { return 3; } // CHECK:STDERR: ^ case x: i32 if (x == 3) { return 3; } diff --git a/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon b/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon index 30e251fa2f42d..96d23ceb5c180 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_pattern.carbon @@ -10,7 +10,7 @@ fn f() -> i32 { match (3) { - // CHECK:STDERR: fail_missing_case_pattern.carbon:[[@LINE+3]]:10: error: expected name in binding pattern + // CHECK:STDERR: fail_missing_case_pattern.carbon:[[@LINE+3]]:10: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: case => { return 2; } // CHECK:STDERR: ^~ case => { return 2; } diff --git a/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon b/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon index 8331610e5a531..a57a77fc412b8 100644 --- a/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_case_statements_block.carbon @@ -11,7 +11,7 @@ fn f() -> i32 { match (3) { case x: i32 => - // CHECK:STDERR: fail_missing_case_statements_block.carbon:[[@LINE+3]]:5: error: expected `{` after `=>` + // CHECK:STDERR: fail_missing_case_statements_block.carbon:[[@LINE+3]]:5: error(ExpectedMatchCaseBlock): expected `{` after `=>` // CHECK:STDERR: default => { return 3; } // CHECK:STDERR: ^~~~~~~ default => { return 3; } diff --git a/toolchain/parse/testdata/match/fail_missing_cases.carbon b/toolchain/parse/testdata/match/fail_missing_cases.carbon index 6eb456fd9fb52..a152ac38331fc 100644 --- a/toolchain/parse/testdata/match/fail_missing_cases.carbon +++ b/toolchain/parse/testdata/match/fail_missing_cases.carbon @@ -10,7 +10,7 @@ fn f() -> i32 { - // CHECK:STDERR: fail_missing_cases.carbon:[[@LINE+3]]:14: error: expected cases + // CHECK:STDERR: fail_missing_cases.carbon:[[@LINE+3]]:14: error(ExpectedMatchCases): expected cases // CHECK:STDERR: match (3) {} // CHECK:STDERR: ^ match (3) {} diff --git a/toolchain/parse/testdata/match/fail_missing_cases_block.carbon b/toolchain/parse/testdata/match/fail_missing_cases_block.carbon index 7b0f2b60bc369..0d59f68b7f122 100644 --- a/toolchain/parse/testdata/match/fail_missing_cases_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_cases_block.carbon @@ -10,7 +10,7 @@ fn f() -> i32 { match (1) - // CHECK:STDERR: fail_missing_cases_block.carbon:[[@LINE+3]]:3: error: expected `{` starting block with cases + // CHECK:STDERR: fail_missing_cases_block.carbon:[[@LINE+3]]:3: error(ExpectedMatchCasesBlock): expected `{` starting block with cases // CHECK:STDERR: return 0; // CHECK:STDERR: ^~~~~~ return 0; diff --git a/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon b/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon index 055b8568b3203..75de71a6768d1 100644 --- a/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon +++ b/toolchain/parse/testdata/match/fail_missing_default_arrow.carbon @@ -10,7 +10,7 @@ fn f() -> i32 { match (3) { - // CHECK:STDERR: fail_missing_default_arrow.carbon:[[@LINE+3]]:13: error: expected `=>` introducing statement block + // CHECK:STDERR: fail_missing_default_arrow.carbon:[[@LINE+3]]:13: error(ExpectedMatchCaseArrow): expected `=>` introducing statement block // CHECK:STDERR: default { return 1; } // CHECK:STDERR: ^ default { return 1; } diff --git a/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon b/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon index 10bd6134a7f83..2258714f2d824 100644 --- a/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon +++ b/toolchain/parse/testdata/match/fail_missing_default_statements_block.carbon @@ -11,7 +11,7 @@ fn f() -> i32 { match (3) { default => - // CHECK:STDERR: fail_missing_default_statements_block.carbon:[[@LINE+3]]:3: error: expected `{` after `=>` + // CHECK:STDERR: fail_missing_default_statements_block.carbon:[[@LINE+3]]:3: error(ExpectedMatchCaseBlock): expected `{` after `=>` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon b/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon index 7564f4aba1789..be303b3067c71 100644 --- a/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon +++ b/toolchain/parse/testdata/match/fail_missing_guard_close_paren.carbon @@ -10,11 +10,11 @@ fn f() -> i32 { match (true) { - // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+7]]:21: error: opening symbol without a corresponding closing symbol + // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+7]]:21: error(UnmatchedOpening): opening symbol without a corresponding closing symbol // CHECK:STDERR: case x: bool if (false => { return 1; } // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+3]]:28: error: TODO: improve match parsing + // CHECK:STDERR: fail_missing_guard_close_paren.carbon:[[@LINE+3]]:28: error(MatchParseTODO): TODO: improve match parsing // CHECK:STDERR: case x: bool if (false => { return 1; } // CHECK:STDERR: ^~ case x: bool if (false => { return 1; } diff --git a/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon b/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon index 74f52411fd61f..2a87de18f657c 100644 --- a/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon +++ b/toolchain/parse/testdata/match/fail_missing_guard_open_paren.carbon @@ -10,11 +10,11 @@ fn f() -> i32 { match (true) { - // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+7]]:21: error: TODO: improve match parsing + // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+7]]:21: error(MatchParseTODO): TODO: improve match parsing // CHECK:STDERR: case x: bool if false) => { return 1; } // CHECK:STDERR: ^~~~~ // CHECK:STDERR: - // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+3]]:26: error: closing symbol without a corresponding opening symbol + // CHECK:STDERR: fail_missing_guard_open_paren.carbon:[[@LINE+3]]:26: error(UnmatchedClosing): closing symbol without a corresponding opening symbol // CHECK:STDERR: case x: bool if false) => { return 1; } // CHECK:STDERR: ^ case x: bool if false) => { return 1; } diff --git a/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon b/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon index f3de2dcdcf5b8..abb55b6ed8d13 100644 --- a/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon +++ b/toolchain/parse/testdata/match/fail_missing_matched_expr.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/match/fail_missing_matched_expr.carbon fn f() -> i32 { - // CHECK:STDERR: fail_missing_matched_expr.carbon:[[@LINE+3]]:9: error: expected `(` after `match` + // CHECK:STDERR: fail_missing_matched_expr.carbon:[[@LINE+3]]:9: error(ExpectedParenAfter): expected `(` after `match` // CHECK:STDERR: match { // CHECK:STDERR: ^ match { diff --git a/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon b/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon index a47d817d433f5..89724c25f0897 100644 --- a/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon +++ b/toolchain/parse/testdata/match/fail_unexpected_tokens_in_cases_block.carbon @@ -11,26 +11,26 @@ fn f() -> i32 { var x: i32 = 3; match (x) { - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `let`; expected `case`, `default` or `}` + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error(UnexpectedTokenInMatchCasesBlock): unexpected `let`; expected `case`, `default` or `}` // CHECK:STDERR: let u: i32 = // CHECK:STDERR: ^~~ // CHECK:STDERR: let u: i32 = case y: i32 if (y > 2) => { return 1; } - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `if`; expected `case`, `default` or `}` + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error(UnexpectedTokenInMatchCasesBlock): unexpected `if`; expected `case`, `default` or `}` // CHECK:STDERR: if (true) { // CHECK:STDERR: ^~ // CHECK:STDERR: if (true) { return 2; } - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `var`; expected `case`, `default` or `}` + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error(UnexpectedTokenInMatchCasesBlock): unexpected `var`; expected `case`, `default` or `}` // CHECK:STDERR: var w // CHECK:STDERR: ^~~ // CHECK:STDERR: var w case z: i32 if (z == 3) => { return 3; } - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `{`; expected `case`, `default` or `}` + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error(UnexpectedTokenInMatchCasesBlock): unexpected `{`; expected `case`, `default` or `}` // CHECK:STDERR: { // CHECK:STDERR: ^ // CHECK:STDERR: @@ -38,12 +38,12 @@ fn f() -> i32 { break; } default => { return 3; } - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error: unexpected `return`; expected `case`, `default` or `}` + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+4]]:5: error(UnexpectedTokenInMatchCasesBlock): unexpected `return`; expected `case`, `default` or `}` // CHECK:STDERR: return 1; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: return 1; - // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+3]]:5: error: unexpected `(`; expected `case`, `default` or `}` + // CHECK:STDERR: fail_unexpected_tokens_in_cases_block.carbon:[[@LINE+3]]:5: error(UnexpectedTokenInMatchCasesBlock): unexpected `(`; expected `case`, `default` or `}` // CHECK:STDERR: ((), (), ()) // CHECK:STDERR: ^ ((), (), ()) diff --git a/toolchain/parse/testdata/member_access/fail_keyword.carbon b/toolchain/parse/testdata/member_access/fail_keyword.carbon index 0cf38144a032a..56f9b2e40c160 100644 --- a/toolchain/parse/testdata/member_access/fail_keyword.carbon +++ b/toolchain/parse/testdata/member_access/fail_keyword.carbon @@ -9,32 +9,32 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/member_access/fail_keyword.carbon fn F() { - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.` + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: a.self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: a.self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.` + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: a.Self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: a.Self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error: expected identifier after `.` + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:5: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: a.for; // CHECK:STDERR: ^~~ // CHECK:STDERR: a.for; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error: expected identifier after `->` + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `->` // CHECK:STDERR: p->self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: p->self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error: expected identifier after `->` + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+4]]:6: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `->` // CHECK:STDERR: p->Self; // CHECK:STDERR: ^~~~ // CHECK:STDERR: p->Self; - // CHECK:STDERR: fail_keyword.carbon:[[@LINE+3]]:6: error: expected identifier after `->` + // CHECK:STDERR: fail_keyword.carbon:[[@LINE+3]]:6: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `->` // CHECK:STDERR: p->while; // CHECK:STDERR: ^~~~~ p->while; diff --git a/toolchain/parse/testdata/namespace/fail_arrow.carbon b/toolchain/parse/testdata/namespace/fail_arrow.carbon index cd020acb01181..defd8c3c52cde 100644 --- a/toolchain/parse/testdata/namespace/fail_arrow.carbon +++ b/toolchain/parse/testdata/namespace/fail_arrow.carbon @@ -10,7 +10,7 @@ namespace Foo; -// CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:10: error: `class` declarations must either end with a `;` or have a `{ ... }` block for a definition +// CHECK:STDERR: fail_arrow.carbon:[[@LINE+3]]:10: error(ExpectedDeclSemiOrDefinition): `class` declarations must either end with a `;` or have a `{ ... }` block for a definition // CHECK:STDERR: class Foo->Bar {} // CHECK:STDERR: ^~ class Foo->Bar {} diff --git a/toolchain/parse/testdata/namespace/fail_incomplete.carbon b/toolchain/parse/testdata/namespace/fail_incomplete.carbon index 2d6a7be5d2501..5488c1e80b0ad 100644 --- a/toolchain/parse/testdata/namespace/fail_incomplete.carbon +++ b/toolchain/parse/testdata/namespace/fail_incomplete.carbon @@ -8,37 +8,37 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_incomplete.carbon -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: namespace 123 // CHECK:STDERR: ^~~ // CHECK:STDERR: namespace 123 -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: namespace "" // CHECK:STDERR: ^~ // CHECK:STDERR: namespace "" -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: namespace + // CHECK:STDERR: ^ // CHECK:STDERR: namespace + -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: namespace bool // CHECK:STDERR: ^~~~ // CHECK:STDERR: namespace bool -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+4]]:11: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: namespace namespace namespace namespace namespace // CHECK:STDERR: ^~~~~~~~~ // CHECK:STDERR: namespace namespace namespace namespace namespace -// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:1: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: namespace // CHECK:STDERR: ^~~~~~~~~ namespace diff --git a/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon b/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon index eec62bff6bd6d..b4fdf77edfc7e 100644 --- a/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon +++ b/toolchain/parse/testdata/namespace/fail_incomplete_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_incomplete_name.carbon -// CHECK:STDERR: fail_incomplete_name.carbon:[[@LINE+3]]:15: error: `.` should be followed by a name +// CHECK:STDERR: fail_incomplete_name.carbon:[[@LINE+3]]:15: error(ExpectedDeclNameAfterPeriod): `.` should be followed by a name // CHECK:STDERR: namespace Foo.; // CHECK:STDERR: ^ namespace Foo.; diff --git a/toolchain/parse/testdata/namespace/fail_modifiers.carbon b/toolchain/parse/testdata/namespace/fail_modifiers.carbon index edca7db78acad..8c6cddd81c25a 100644 --- a/toolchain/parse/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/parse/testdata/namespace/fail_modifiers.carbon @@ -10,11 +10,11 @@ virtual namespace B -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: error: `namespace` declarations must end with a `;` +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1: error(ExpectedDeclSemi): `namespace` declarations must end with a `;` // CHECK:STDERR: impl namespace // CHECK:STDERR: ^~~~ // CHECK:STDERR: -// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:6: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:6: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: impl namespace // CHECK:STDERR: ^~~~~~~~~ impl namespace diff --git a/toolchain/parse/testdata/namespace/fail_no_name.carbon b/toolchain/parse/testdata/namespace/fail_no_name.carbon index 3604f32ae509e..45d00edfa4b78 100644 --- a/toolchain/parse/testdata/namespace/fail_no_name.carbon +++ b/toolchain/parse/testdata/namespace/fail_no_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/namespace/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:10: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:10: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: namespace; // CHECK:STDERR: ^ namespace; diff --git a/toolchain/parse/testdata/operators/fail_chained_assign.carbon b/toolchain/parse/testdata/operators/fail_chained_assign.carbon index 58722842476d0..8f81f7e063c31 100644 --- a/toolchain/parse/testdata/operators/fail_chained_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_chained_assign.carbon @@ -13,7 +13,7 @@ fn F() { var b: i32; // TODO: Produce a custom diagnostic for this. - // CHECK:STDERR: fail_chained_assign.carbon:[[@LINE+3]]:9: error: operator `=` can only be used as a complete statement + // CHECK:STDERR: fail_chained_assign.carbon:[[@LINE+3]]:9: error(StatementOperatorAsSubExpr): operator `=` can only be used as a complete statement // CHECK:STDERR: a = b = 1; // CHECK:STDERR: ^ a = b = 1; diff --git a/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon b/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon index f9c7ff8e42d36..c30ce8f32b65f 100644 --- a/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon +++ b/toolchain/parse/testdata/operators/fail_infix_uneven_space_after.carbon @@ -10,7 +10,7 @@ // TODO: We could figure out that this first Failed example is infix // with one-token lookahead. -// CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+3]]:16: error: `var` declarations must end with a `;` +// CHECK:STDERR: fail_infix_uneven_space_after.carbon:[[@LINE+3]]:16: error(ExpectedDeclSemi): `var` declarations must end with a `;` // CHECK:STDERR: var n: i8 = n* n; // CHECK:STDERR: ^ var n: i8 = n* n; diff --git a/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon b/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon index 5bfa6535ff90c..5fcdac6ea8664 100644 --- a/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon +++ b/toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_infix_uneven_space_before.carbon -// CHECK:STDERR: fail_infix_uneven_space_before.carbon:[[@LINE+3]]:15: error: whitespace missing after binary operator +// CHECK:STDERR: fail_infix_uneven_space_before.carbon:[[@LINE+3]]:15: error(BinaryOperatorRequiresWhitespace): whitespace missing after binary operator // CHECK:STDERR: var n: i8 = n *n; // CHECK:STDERR: ^ var n: i8 = n *n; diff --git a/toolchain/parse/testdata/operators/fail_invalid_infix.carbon b/toolchain/parse/testdata/operators/fail_invalid_infix.carbon index 328058a59170d..8ea075cfd2657 100644 --- a/toolchain/parse/testdata/operators/fail_invalid_infix.carbon +++ b/toolchain/parse/testdata/operators/fail_invalid_infix.carbon @@ -8,21 +8,21 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_invalid_infix.carbon -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:19: error: expected expression +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:19: error(ExpectedExpr): expected expression // CHECK:STDERR: var a: i32 = n == ; // CHECK:STDERR: ^ // CHECK:STDERR: var a: i32 = n == ; -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:14: error: expected expression +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+4]]:14: error(ExpectedExpr): expected expression // CHECK:STDERR: var b: i32 = == n; // CHECK:STDERR: ^~ // CHECK:STDERR: var b: i32 = == n; -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+7]]:14: error: expected expression +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+7]]:14: error(ExpectedExpr): expected expression // CHECK:STDERR: var c: i32 = == ; // CHECK:STDERR: ^~ // CHECK:STDERR: -// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+3]]:17: error: expected expression +// CHECK:STDERR: fail_invalid_infix.carbon:[[@LINE+3]]:17: error(ExpectedExpr): expected expression // CHECK:STDERR: var c: i32 = == ; // CHECK:STDERR: ^ var c: i32 = == ; diff --git a/toolchain/parse/testdata/operators/fail_postfix_space.carbon b/toolchain/parse/testdata/operators/fail_postfix_space.carbon index 375e699d4678e..d6b889d9d16d5 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space.carbon -// CHECK:STDERR: fail_postfix_space.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator +// CHECK:STDERR: fail_postfix_space.carbon:[[@LINE+3]]:18: error(UnaryOperatorHasWhitespace): whitespace is not allowed before this unary operator // CHECK:STDERR: var v: type = i8 *; // CHECK:STDERR: ^ var v: type = i8 *; diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon index 95a8b13a47deb..e9ba9e7302edc 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_before_comma.carbon -// CHECK:STDERR: fail_postfix_space_before_comma.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator +// CHECK:STDERR: fail_postfix_space_before_comma.carbon:[[@LINE+3]]:18: error(UnaryOperatorHasWhitespace): whitespace is not allowed before this unary operator // CHECK:STDERR: var n: i8 = F(i8 *, 0); // CHECK:STDERR: ^ var n: i8 = F(i8 *, 0); diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon index b31da2a7af4e1..2a511a74dbac6 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_in_call.carbon -// CHECK:STDERR: fail_postfix_space_in_call.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator +// CHECK:STDERR: fail_postfix_space_in_call.carbon:[[@LINE+3]]:18: error(UnaryOperatorHasWhitespace): whitespace is not allowed before this unary operator // CHECK:STDERR: var n: i8 = F(i8 *); // CHECK:STDERR: ^ var n: i8 = F(i8 *); diff --git a/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon b/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon index acbb30868b77d..aecc5ab1d0a23 100644 --- a/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon +++ b/toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_postfix_space_surrounding.carbon -// CHECK:STDERR: fail_postfix_space_surrounding.carbon:[[@LINE+3]]:18: error: whitespace is not allowed before this unary operator +// CHECK:STDERR: fail_postfix_space_surrounding.carbon:[[@LINE+3]]:18: error(UnaryOperatorHasWhitespace): whitespace is not allowed before this unary operator // CHECK:STDERR: var v: type = i8 * ; // CHECK:STDERR: ^ var v: type = i8 * ; diff --git a/toolchain/parse/testdata/operators/fail_postincrement.carbon b/toolchain/parse/testdata/operators/fail_postincrement.carbon index f539c4c85f6a0..c2d8a2fb1af58 100644 --- a/toolchain/parse/testdata/operators/fail_postincrement.carbon +++ b/toolchain/parse/testdata/operators/fail_postincrement.carbon @@ -11,12 +11,12 @@ fn F() { var n: i32 = 0; // TODO: It'd be nice to produce a custom diagnostic here. - // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement + // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+4]]:4: error(ExpectedExprSemi): expected `;` after expression statement // CHECK:STDERR: n++; // CHECK:STDERR: ^~ // CHECK:STDERR: n++; - // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+3]]:4: error: expected `;` after expression statement + // CHECK:STDERR: fail_postincrement.carbon:[[@LINE+3]]:4: error(ExpectedExprSemi): expected `;` after expression statement // CHECK:STDERR: n--; // CHECK:STDERR: ^~ n--; diff --git a/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon b/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon index be56acc3f61f0..dfa74588071fd 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_and_or.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_precedence_and_or.carbon fn F() { - // CHECK:STDERR: fail_precedence_and_or.carbon:[[@LINE+3]]:11: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_and_or.carbon:[[@LINE+3]]:11: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: a and b or c; // CHECK:STDERR: ^~ a and b or c; diff --git a/toolchain/parse/testdata/operators/fail_precedence_as.carbon b/toolchain/parse/testdata/operators/fail_precedence_as.carbon index 58b18ae37de45..562132001eb15 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_as.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_as.carbon @@ -10,43 +10,43 @@ fn F(n: i32) { // No ordering between `not` and `as`. - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: not true as bool; // CHECK:STDERR: ^~ // CHECK:STDERR: not true as bool; // No ordering between mathematical binary operators and `as`. - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: 1 + 1 as i32; // CHECK:STDERR: ^~ // CHECK:STDERR: 1 + 1 as i32; - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:9: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: 5 % 2 as i32; // CHECK:STDERR: ^~ // CHECK:STDERR: 5 % 2 as i32; // No ordering between logical binary operators and `as`. - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: 3 as i32 and true; // CHECK:STDERR: ^~~ // CHECK:STDERR: 3 as i32 and true; - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:14: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:14: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: false or 4 as i32; // CHECK:STDERR: ^~ // CHECK:STDERR: false or 4 as i32; // No ordering between relational binary operators and `as`. - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+4]]:12: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: 6 as i32 == 7; // CHECK:STDERR: ^~ // CHECK:STDERR: 6 as i32 == 7; - // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+3]]:10: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_as.carbon:[[@LINE+3]]:10: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: 8 <= 9 as i32; // CHECK:STDERR: ^~ 8 <= 9 as i32; diff --git a/toolchain/parse/testdata/operators/fail_precedence_assign.carbon b/toolchain/parse/testdata/operators/fail_precedence_assign.carbon index e6805a40a9c34..eb9ad2b44ca0d 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_assign.carbon @@ -12,26 +12,26 @@ fn F() { var a: i32; // Assignment can only appear as an expression statement, not as a subexpression. // TODO: Produce the "can only be used as a complete statement" diagnostic in each of these cases. - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:10: error: expected `,` or `)` + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:10: error(UnexpectedTokenAfterListElement): expected `,` or `)` // CHECK:STDERR: 1 + (a = 1); // CHECK:STDERR: ^ // CHECK:STDERR: 1 + (a = 1); - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+8]]:19: error: expected `else` after `if ... then ...` + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+8]]:19: error(ExpectedElseAfterIf): expected `else` after `if ... then ...` // CHECK:STDERR: (if true then a += 1 else a /= 2); // CHECK:STDERR: ^~ // CHECK:STDERR: - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:19: error: expected `,` or `)` + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:19: error(UnexpectedTokenAfterListElement): expected `,` or `)` // CHECK:STDERR: (if true then a += 1 else a /= 2); // CHECK:STDERR: ^~ // CHECK:STDERR: (if true then a += 1 else a /= 2); - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:7: error: operator `++` can only be used as a complete statement + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+4]]:7: error(StatementOperatorAsSubExpr): operator `++` can only be used as a complete statement // CHECK:STDERR: a + ++a; // CHECK:STDERR: ^~ // CHECK:STDERR: a + ++a; - // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+3]]:5: error: parentheses are required around this unary `if` operator + // CHECK:STDERR: fail_precedence_assign.carbon:[[@LINE+3]]:5: error(UnaryOperatorRequiresParentheses): parentheses are required around this unary `if` operator // CHECK:STDERR: ++if c then a else b; // CHECK:STDERR: ^~ ++if c then a else b; diff --git a/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon b/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon index 8beaf3bceeb33..29895f5aa2779 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_or_and.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_precedence_or_and.carbon fn F() { - // CHECK:STDERR: fail_precedence_or_and.carbon:[[@LINE+3]]:10: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_precedence_or_and.carbon:[[@LINE+3]]:10: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: a or b and c; // CHECK:STDERR: ^~~ a or b and c; diff --git a/toolchain/parse/testdata/operators/fail_precedence_where.carbon b/toolchain/parse/testdata/operators/fail_precedence_where.carbon index 8c2b37ba34936..479b2b243fda0 100644 --- a/toolchain/parse/testdata/operators/fail_precedence_where.carbon +++ b/toolchain/parse/testdata/operators/fail_precedence_where.carbon @@ -11,7 +11,7 @@ // --- fail_and_where.carbon fn AndWhere() { - // CHECK:STDERR: fail_and_where.carbon:[[@LINE+4]]:14: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_and_where.carbon:[[@LINE+4]]:14: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: true and T where .A = B; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -21,7 +21,7 @@ fn AndWhere() { // --- fail_where_or.carbon fn WhereOr() { - // CHECK:STDERR: fail_where_or.carbon:[[@LINE+4]]:22: error: expected `;` after expression statement + // CHECK:STDERR: fail_where_or.carbon:[[@LINE+4]]:22: error(ExpectedExprSemi): expected `;` after expression statement // CHECK:STDERR: U where .C impls D or false; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -31,7 +31,7 @@ fn WhereOr() { // --- fail_equals_where.carbon fn EqualsWhere() { - // CHECK:STDERR: fail_equals_where.carbon:[[@LINE+4]]:10: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_equals_where.carbon:[[@LINE+4]]:10: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: e == V where .G == f32; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -41,7 +41,7 @@ fn EqualsWhere() { // --- fail_where_neq.carbon fn WhereNEq() { - // CHECK:STDERR: fail_where_neq.carbon:[[@LINE+4]]:21: error: expected `;` after expression statement + // CHECK:STDERR: fail_where_neq.carbon:[[@LINE+4]]:21: error(ExpectedExprSemi): expected `;` after expression statement // CHECK:STDERR: W where .H = bool != i; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -51,7 +51,7 @@ fn WhereNEq() { // --- fail_less_requirement.carbon fn LessRequirement() { - // CHECK:STDERR: fail_less_requirement.carbon:[[@LINE+4]]:14: error: requirement should use `impls`, `=`, or `==` operator + // CHECK:STDERR: fail_less_requirement.carbon:[[@LINE+4]]:14: error(ExpectedRequirementOperator): requirement should use `impls`, `=`, or `==` operator // CHECK:STDERR: X where .J < .K; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -61,7 +61,7 @@ fn LessRequirement() { // --- fail_as_where.carbon fn AsWhere() { - // CHECK:STDERR: fail_as_where.carbon:[[@LINE+4]]:10: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_as_where.carbon:[[@LINE+4]]:10: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: Y as Z where .L impls M; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -71,7 +71,7 @@ fn AsWhere() { // --- fail_where_as.carbon fn WhereAs() { - // CHECK:STDERR: fail_where_as.carbon:[[@LINE+4]]:21: error: expected `;` after expression statement + // CHECK:STDERR: fail_where_as.carbon:[[@LINE+4]]:21: error(ExpectedExprSemi): expected `;` after expression statement // CHECK:STDERR: S where .N == i32 as type; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -81,7 +81,7 @@ fn WhereAs() { // --- fail_as_in_argument.carbon fn AsInArgument() { - // CHECK:STDERR: fail_as_in_argument.carbon:[[@LINE+4]]:14: error: requirement should use `impls`, `=`, or `==` operator + // CHECK:STDERR: fail_as_in_argument.carbon:[[@LINE+4]]:14: error(ExpectedRequirementOperator): requirement should use `impls`, `=`, or `==` operator // CHECK:STDERR: R where .O as type impls P; // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -91,7 +91,7 @@ fn AsInArgument() { // --- fail_greater_in_argument.carbon fn GreaterInArgument() { - // CHECK:STDERR: fail_greater_in_argument.carbon:[[@LINE+3]]:15: error: requirement should use `impls`, `=`, or `==` operator + // CHECK:STDERR: fail_greater_in_argument.carbon:[[@LINE+3]]:15: error(ExpectedRequirementOperator): requirement should use `impls`, `=`, or `==` operator // CHECK:STDERR: Q where .AA > .BB impls CC; // CHECK:STDERR: ^ Q where .AA > .BB impls CC; diff --git a/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon b/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon index 3daa7a0ce6c44..c0b0622baa854 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_repeat.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_repeat.carbon -// CHECK:STDERR: fail_prefix_repeat.carbon:[[@LINE+3]]:17: error: parentheses are required around this unary `const` operator +// CHECK:STDERR: fail_prefix_repeat.carbon:[[@LINE+3]]:17: error(UnaryOperatorRequiresParentheses): parentheses are required around this unary `const` operator // CHECK:STDERR: fn F() -> const const i32* { // CHECK:STDERR: ^~~~~ fn F() -> const const i32* { diff --git a/toolchain/parse/testdata/operators/fail_prefix_space.carbon b/toolchain/parse/testdata/operators/fail_prefix_space.carbon index f450185a540dd..162fe6cac1dc9 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_space.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_space.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_space.carbon -// CHECK:STDERR: fail_prefix_space.carbon:[[@LINE+3]]:13: error: whitespace is not allowed after this unary operator +// CHECK:STDERR: fail_prefix_space.carbon:[[@LINE+3]]:13: error(UnaryOperatorHasWhitespace): whitespace is not allowed after this unary operator // CHECK:STDERR: var n: i8 = - n; // CHECK:STDERR: ^ var n: i8 = - n; diff --git a/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon b/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon index 89faab0f44844..78107aa1b2285 100644 --- a/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon +++ b/toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_prefix_uneven_space_with_assign.carbon -// CHECK:STDERR: fail_prefix_uneven_space_with_assign.carbon:[[@LINE+3]]:12: error: whitespace is not allowed after this unary operator +// CHECK:STDERR: fail_prefix_uneven_space_with_assign.carbon:[[@LINE+3]]:12: error(UnaryOperatorHasWhitespace): whitespace is not allowed after this unary operator // CHECK:STDERR: var n: i8 =- n; // CHECK:STDERR: ^ var n: i8 =- n; diff --git a/toolchain/parse/testdata/operators/fail_star_minus.carbon b/toolchain/parse/testdata/operators/fail_star_minus.carbon index 22792f5aa2373..de7ecf10aad31 100644 --- a/toolchain/parse/testdata/operators/fail_star_minus.carbon +++ b/toolchain/parse/testdata/operators/fail_star_minus.carbon @@ -13,7 +13,7 @@ // available because it has already accepted that first part of the expression, // so it is recovering by using the second option, but the diagnostic should // ideally offer (or consider) both fixes as alternatives. -// CHECK:STDERR: fail_star_minus.carbon:[[@LINE+3]]:16: error: whitespace missing after binary operator +// CHECK:STDERR: fail_star_minus.carbon:[[@LINE+3]]:16: error(BinaryOperatorRequiresWhitespace): whitespace missing after binary operator // CHECK:STDERR: var n: i8 = n* -n; // CHECK:STDERR: ^ var n: i8 = n* -n; diff --git a/toolchain/parse/testdata/operators/fail_star_star.carbon b/toolchain/parse/testdata/operators/fail_star_star.carbon index 496bc8225af55..1c8080e224bd2 100644 --- a/toolchain/parse/testdata/operators/fail_star_star.carbon +++ b/toolchain/parse/testdata/operators/fail_star_star.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_star_star.carbon -// CHECK:STDERR: fail_star_star.carbon:[[@LINE+3]]:16: error: whitespace missing after binary operator +// CHECK:STDERR: fail_star_star.carbon:[[@LINE+3]]:16: error(BinaryOperatorRequiresWhitespace): whitespace missing after binary operator // CHECK:STDERR: var n: i8 = n* *p; // CHECK:STDERR: ^ var n: i8 = n* *p; diff --git a/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon b/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon index e55133c8694cc..e7d90a39c510d 100644 --- a/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon +++ b/toolchain/parse/testdata/operators/fail_star_star_no_space.carbon @@ -12,7 +12,7 @@ // before we notice the missing whitespace around the second `*`. // It'd be better to (somehow) form n*(*p) and reject due to the missing // whitespace around the first `*`. -// CHECK:STDERR: fail_star_star_no_space.carbon:[[@LINE+3]]:16: error: `var` declarations must end with a `;` +// CHECK:STDERR: fail_star_star_no_space.carbon:[[@LINE+3]]:16: error(ExpectedDeclSemi): `var` declarations must end with a `;` // CHECK:STDERR: var n: i8 = n**p; // CHECK:STDERR: ^ var n: i8 = n**p; diff --git a/toolchain/parse/testdata/operators/fail_variety.carbon b/toolchain/parse/testdata/operators/fail_variety.carbon index 706d25c8be25b..af30d4fb6833c 100644 --- a/toolchain/parse/testdata/operators/fail_variety.carbon +++ b/toolchain/parse/testdata/operators/fail_variety.carbon @@ -9,23 +9,23 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/operators/fail_variety.carbon fn F() { - // CHECK:STDERR: fail_variety.carbon:[[@LINE+19]]:21: error: operator `=` can only be used as a complete statement + // CHECK:STDERR: fail_variety.carbon:[[@LINE+19]]:21: error(StatementOperatorAsSubExpr): operator `=` can only be used as a complete statement // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+15]]:29: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_variety.carbon:[[@LINE+15]]:29: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^~ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+11]]:34: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_variety.carbon:[[@LINE+11]]:34: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+7]]:38: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_variety.carbon:[[@LINE+7]]:38: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^ // CHECK:STDERR: - // CHECK:STDERR: fail_variety.carbon:[[@LINE+3]]:40: error: parentheses are required around this unary `not` operator + // CHECK:STDERR: fail_variety.carbon:[[@LINE+3]]:40: error(UnaryOperatorRequiresParentheses): parentheses are required around this unary `not` operator // CHECK:STDERR: n = a * b + c * d = d * d << e & f - not g; // CHECK:STDERR: ^~~ n = a * b + c * d = d * d << e & f - not g; diff --git a/toolchain/parse/testdata/package_expr/fail_in_name.carbon b/toolchain/parse/testdata/package_expr/fail_in_name.carbon index 8b391283b85ca..c8ca38755fcd7 100644 --- a/toolchain/parse/testdata/package_expr/fail_in_name.carbon +++ b/toolchain/parse/testdata/package_expr/fail_in_name.carbon @@ -8,19 +8,19 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/package_expr/fail_in_name.carbon -// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:5: error: expected name in binding pattern +// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:5: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: var package.val: i32; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: var package.val: i32; -// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:11: error: `namespace` introducer should be followed by a name +// CHECK:STDERR: fail_in_name.carbon:[[@LINE+4]]:11: error(ExpectedDeclName): `namespace` introducer should be followed by a name // CHECK:STDERR: namespace package.NS; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: namespace package.NS; -// CHECK:STDERR: fail_in_name.carbon:[[@LINE+3]]:7: error: `class` introducer should be followed by a name +// CHECK:STDERR: fail_in_name.carbon:[[@LINE+3]]:7: error(ExpectedDeclName): `class` introducer should be followed by a name // CHECK:STDERR: class package.C { // CHECK:STDERR: ^~~~~~~ class package.C { diff --git a/toolchain/parse/testdata/packages/export.carbon b/toolchain/parse/testdata/packages/export.carbon index 6931cffc154b4..d1d42dfec9937 100644 --- a/toolchain/parse/testdata/packages/export.carbon +++ b/toolchain/parse/testdata/packages/export.carbon @@ -28,7 +28,7 @@ export Foo.Bar; package Pkg; -// CHECK:STDERR: fail_expr.carbon:[[@LINE+4]]:8: error: `export` introducer should be followed by a name +// CHECK:STDERR: fail_expr.carbon:[[@LINE+4]]:8: error(ExpectedDeclName): `export` introducer should be followed by a name // CHECK:STDERR: export (); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -38,7 +38,7 @@ export (); package Pkg; -// CHECK:STDERR: fail_package_in_name.carbon:[[@LINE+4]]:8: error: `export` introducer should be followed by a name +// CHECK:STDERR: fail_package_in_name.carbon:[[@LINE+4]]:8: error(ExpectedDeclName): `export` introducer should be followed by a name // CHECK:STDERR: export package.Bar; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -48,7 +48,7 @@ export package.Bar; package Pkg; -// CHECK:STDERR: fail_keyword_only:[[@LINE+4]]:1: error: `export` introducer should be followed by a name +// CHECK:STDERR: fail_keyword_only:[[@LINE+4]]:1: error(ExpectedDeclName): `export` introducer should be followed by a name // CHECK:STDERR: export // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -58,7 +58,7 @@ export package Pkg; -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+4]]:8: error: `export` introducer should be followed by a name +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+4]]:8: error(ExpectedDeclName): `export` introducer should be followed by a name // CHECK:STDERR: export ; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -69,7 +69,7 @@ export ; package Pkg; export Foo -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:1: error: `export` declarations must end with a `;` +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:1: error(ExpectedDeclSemi): `export` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDERR: ^ // CHECK:STDERR: @@ -78,7 +78,7 @@ export Foo package Pkg; -// CHECK:STDERR: fail_incomplete_qual_name.carbon:[[@LINE+4]]:12: error: `.` should be followed by a name +// CHECK:STDERR: fail_incomplete_qual_name.carbon:[[@LINE+4]]:12: error(ExpectedDeclNameAfterPeriod): `.` should be followed by a name // CHECK:STDERR: export Foo.; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -88,7 +88,7 @@ export Foo.; package Pkg; -// CHECK:STDERR: fail_incomplete_qual_name2.carbon:[[@LINE+4]]:8: error: `export` introducer should be followed by a name +// CHECK:STDERR: fail_incomplete_qual_name2.carbon:[[@LINE+4]]:8: error(ExpectedDeclName): `export` introducer should be followed by a name // CHECK:STDERR: export .Bar; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -108,10 +108,10 @@ package Pkg; export Foo; -// CHECK:STDERR: fail_before_import.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file +// CHECK:STDERR: fail_before_import.carbon:[[@LINE+7]]:1: error(ImportTooLate): `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import library "lib"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_before_import.carbon:[[@LINE-5]]:1: note: first declaration is here +// CHECK:STDERR: fail_before_import.carbon:[[@LINE-5]]:1: note(FirstDecl): first declaration is here // CHECK:STDERR: export Foo; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -119,7 +119,7 @@ import library "lib"; // --- fail_in_default_library.carbon -// CHECK:STDERR: fail_in_default_library.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files +// CHECK:STDERR: fail_in_default_library.carbon:[[@LINE+4]]:1: error(ExportFromImpl): `export` is only allowed in API files // CHECK:STDERR: export Foo; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -129,7 +129,7 @@ export Foo; impl package Pkg; -// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: error: `export` is only allowed in API files +// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: error(ExportFromImpl): `export` is only allowed in API files // CHECK:STDERR: export Foo; // CHECK:STDERR: ^~~~~~ export Foo; diff --git a/toolchain/parse/testdata/packages/import/export.carbon b/toolchain/parse/testdata/packages/import/export.carbon index b79a586936fb7..503d47bf75bbb 100644 --- a/toolchain/parse/testdata/packages/import/export.carbon +++ b/toolchain/parse/testdata/packages/import/export.carbon @@ -12,7 +12,7 @@ package Pkg; -// CHECK:STDERR: fail_package.carbon:[[@LINE+4]]:15: error: `export` cannot be used when importing a package +// CHECK:STDERR: fail_package.carbon:[[@LINE+4]]:15: error(ExportImportPackage): `export` cannot be used when importing a package // CHECK:STDERR: export import Bar; // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -38,10 +38,10 @@ export import library "a"; class C; -// CHECK:STDERR: fail_order.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file +// CHECK:STDERR: fail_order.carbon:[[@LINE+7]]:1: error(ImportTooLate): `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: export import library "b"; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_order.carbon:[[@LINE-5]]:1: note: first declaration is here +// CHECK:STDERR: fail_order.carbon:[[@LINE-5]]:1: note(FirstDecl): first declaration is here // CHECK:STDERR: class C; // CHECK:STDERR: ^~~~~ // CHECK:STDERR: @@ -49,7 +49,7 @@ export import library "b"; // --- fail_in_default_library.carbon -// CHECK:STDERR: fail_in_default_library.carbon:[[@LINE+4]]:1: error: `export` is only allowed in API files +// CHECK:STDERR: fail_in_default_library.carbon:[[@LINE+4]]:1: error(ExportFromImpl): `export` is only allowed in API files // CHECK:STDERR: export import library "lib"; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -59,7 +59,7 @@ export import library "lib"; impl package Pkg; -// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: error: `export` is only allowed in API files +// CHECK:STDERR: fail_in_impl.carbon:[[@LINE+3]]:1: error(ExportFromImpl): `export` is only allowed in API files // CHECK:STDERR: export import library "lib"; // CHECK:STDERR: ^~~~~~ export import library "lib"; diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon index 16b79b8e28eed..5f333758a02dc 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl.carbon @@ -10,10 +10,10 @@ fn A(); -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error(ImportTooLate): `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: note: first declaration is here +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: note(FirstDecl): first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ import B; diff --git a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon index bd4b3418ce4b2..705d71cc883e9 100644 --- a/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon +++ b/toolchain/parse/testdata/packages/import/fail_after_decl_repeated.carbon @@ -10,10 +10,10 @@ fn A(); -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error(ImportTooLate): `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import B; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-5]]:1: note: first declaration is here +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-5]]:1: note(FirstDecl): first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -21,10 +21,10 @@ import B; // Note this is still invalid, but doesn't warn because it's sequential. import C; -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error: the `package` declaration must be the first non-comment line +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+7]]:1: error(PackageTooLate): the `package` declaration must be the first non-comment line // CHECK:STDERR: package D; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-16]]:1: note: first non-comment line is here +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-16]]:1: note(FirstNonCommentLine): first non-comment line is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ // CHECK:STDERR: @@ -32,10 +32,10 @@ package D; fn E(); -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+6]]:1: error: `import` declarations must come after the `package` declaration (if present) and before any other entities in the file +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE+6]]:1: error(ImportTooLate): `import` declarations must come after the `package` declaration (if present) and before any other entities in the file // CHECK:STDERR: import F; // CHECK:STDERR: ^~~~~~ -// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-27]]:1: note: first declaration is here +// CHECK:STDERR: fail_after_decl_repeated.carbon:[[@LINE-27]]:1: note(FirstDecl): first declaration is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ import F; diff --git a/toolchain/parse/testdata/packages/import/fail_extra_string.carbon b/toolchain/parse/testdata/packages/import/fail_extra_string.carbon index d87628d54685e..25009262fc7c9 100644 --- a/toolchain/parse/testdata/packages/import/fail_extra_string.carbon +++ b/toolchain/parse/testdata/packages/import/fail_extra_string.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_extra_string.carbon -// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:26: error: `import` declarations must end with a `;` +// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:26: error(ExpectedDeclSemi): `import` declarations must end with a `;` // CHECK:STDERR: import Foo library "bar" "baz"; // CHECK:STDERR: ^~~~~ import Foo library "bar" "baz"; diff --git a/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon b/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon index 8be5617b08de2..1eaed3334fcf9 100644 --- a/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon +++ b/toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_library_is_identifier.carbon -// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:25: error: expected a string literal to specify the library name +// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:25: error(ExpectedLibraryName): expected a string literal to specify the library name // CHECK:STDERR: import Geometry library Shapes; // CHECK:STDERR: ^~~~~~ import Geometry library Shapes; diff --git a/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon b/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon index 8ca4c06864587..d94b3a8863431 100644 --- a/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon +++ b/toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_name_is_keyword.carbon -// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:8: error: expected identifier or `library` after `import` +// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:8: error(ExpectedIdentifierAfterImport): expected identifier or `library` after `import` // CHECK:STDERR: import fn; // CHECK:STDERR: ^~ import fn; diff --git a/toolchain/parse/testdata/packages/import/fail_no_name.carbon b/toolchain/parse/testdata/packages/import/fail_no_name.carbon index c0436e010efef..1207763ddb018 100644 --- a/toolchain/parse/testdata/packages/import/fail_no_name.carbon +++ b/toolchain/parse/testdata/packages/import/fail_no_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:7: error: expected identifier or `library` after `import` +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:7: error(ExpectedIdentifierAfterImport): expected identifier or `library` after `import` // CHECK:STDERR: import; // CHECK:STDERR: ^ import; diff --git a/toolchain/parse/testdata/packages/import/fail_no_semi.carbon b/toolchain/parse/testdata/packages/import/fail_no_semi.carbon index b0f6913c9745f..730dceb2bdbb2 100644 --- a/toolchain/parse/testdata/packages/import/fail_no_semi.carbon +++ b/toolchain/parse/testdata/packages/import/fail_no_semi.carbon @@ -10,7 +10,7 @@ import Geometry -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: error: `import` declarations must end with a `;` +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: error(ExpectedDeclSemi): `import` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon b/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon index 6dbb4947044f5..2b6d58c96e319 100644 --- a/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon +++ b/toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_omit_library_keyword.carbon -// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:17: error: missing `library` keyword +// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:17: error(MissingLibraryKeyword): missing `library` keyword // CHECK:STDERR: import Geometry "Shapes"; // CHECK:STDERR: ^~~~~~~~ import Geometry "Shapes"; diff --git a/toolchain/parse/testdata/packages/import/fail_type.carbon b/toolchain/parse/testdata/packages/import/fail_type.carbon index cca3d921c8574..04418c4d137de 100644 --- a/toolchain/parse/testdata/packages/import/fail_type.carbon +++ b/toolchain/parse/testdata/packages/import/fail_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/import/fail_type.carbon -// CHECK:STDERR: fail_type.carbon:[[@LINE+3]]:17: error: `import` declarations must end with a `;` +// CHECK:STDERR: fail_type.carbon:[[@LINE+3]]:17: error(ExpectedDeclSemi): `import` declarations must end with a `;` // CHECK:STDERR: import Geometry api; // CHECK:STDERR: ^~~ import Geometry api; diff --git a/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon b/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon index a5bdcc0255d2e..cdb09e8244b0f 100644 --- a/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon +++ b/toolchain/parse/testdata/packages/library/fail_invalid_name.carbon @@ -10,7 +10,7 @@ // --- fail_identifier.carbon -// CHECK:STDERR: fail_identifier.carbon:[[@LINE+4]]:9: error: expected `default` or a string literal to specify the library name +// CHECK:STDERR: fail_identifier.carbon:[[@LINE+4]]:9: error(ExpectedLibraryNameOrDefault): expected `default` or a string literal to specify the library name // CHECK:STDERR: library Shapes; // CHECK:STDERR: ^~~~~~ // CHECK:STDERR: @@ -18,7 +18,7 @@ library Shapes; // --- fail_raw_identifier.carbon -// CHECK:STDERR: fail_raw_identifier.carbon:[[@LINE+4]]:9: error: expected `default` or a string literal to specify the library name +// CHECK:STDERR: fail_raw_identifier.carbon:[[@LINE+4]]:9: error(ExpectedLibraryNameOrDefault): expected `default` or a string literal to specify the library name // CHECK:STDERR: library r#default; // CHECK:STDERR: ^~~~~~~ // CHECK:STDERR: @@ -26,7 +26,7 @@ library r#default; // --- fail_missing.carbon -// CHECK:STDERR: fail_missing.carbon:[[@LINE+4]]:8: error: expected `default` or a string literal to specify the library name +// CHECK:STDERR: fail_missing.carbon:[[@LINE+4]]:8: error(ExpectedLibraryNameOrDefault): expected `default` or a string literal to specify the library name // CHECK:STDERR: library; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -34,7 +34,7 @@ library; // --- fail_missing_with_api.carbon -// CHECK:STDERR: fail_missing_with_api.carbon:[[@LINE+4]]:8: error: expected `default` or a string literal to specify the library name +// CHECK:STDERR: fail_missing_with_api.carbon:[[@LINE+4]]:8: error(ExpectedLibraryNameOrDefault): expected `default` or a string literal to specify the library name // CHECK:STDERR: library; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -42,7 +42,7 @@ library; // --- fail_trailing_impl.carbon -// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+4]]:25: error: `library` declarations must end with a `;` +// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+4]]:25: error(ExpectedDeclSemi): `library` declarations must end with a `;` // CHECK:STDERR: library "trailing_impl" impl // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -52,7 +52,7 @@ library "[[@TEST_NAME]]" impl library "[[@TEST_NAME]]" -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+46]]:21: error: `library` declarations must end with a `;` +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+46]]:21: error(ExpectedDeclSemi): `library` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_identifier.carbon diff --git a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon index b7f070f681eb5..0a6338ae4728b 100644 --- a/toolchain/parse/testdata/packages/library/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/library/fail_semi_before.carbon @@ -10,10 +10,10 @@ ; -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error: the `library` declaration must be the first non-comment line +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error(PackageTooLate): the `library` declaration must be the first non-comment line // CHECK:STDERR: library "semi_before"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: note: first non-comment line is here +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: note(FirstNonCommentLine): first non-comment line is here // CHECK:STDERR: ; // CHECK:STDERR: ^ library "[[@TEST_NAME]]"; diff --git a/toolchain/parse/testdata/packages/library/fail_too_late.carbon b/toolchain/parse/testdata/packages/library/fail_too_late.carbon index 69b12c5c640ac..56b6e0e5652e8 100644 --- a/toolchain/parse/testdata/packages/library/fail_too_late.carbon +++ b/toolchain/parse/testdata/packages/library/fail_too_late.carbon @@ -10,10 +10,10 @@ import Geometry; -// CHECK:STDERR: fail_too_late.carbon:[[@LINE+6]]:1: error: the `library` declaration must be the first non-comment line +// CHECK:STDERR: fail_too_late.carbon:[[@LINE+6]]:1: error(PackageTooLate): the `library` declaration must be the first non-comment line // CHECK:STDERR: library "too_late"; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: note: first non-comment line is here +// CHECK:STDERR: fail_too_late.carbon:[[@LINE-5]]:1: note(FirstNonCommentLine): first non-comment line is here // CHECK:STDERR: import Geometry; // CHECK:STDERR: ^~~~~~ library "[[@TEST_NAME]]"; diff --git a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon index 6e4236cebe61d..b6f88f4047ca7 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_decl.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_decl.carbon @@ -10,10 +10,10 @@ fn A(); -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE+6]]:1: error(PackageTooLate): the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: note: first non-comment line is here +// CHECK:STDERR: fail_after_decl.carbon:[[@LINE-5]]:1: note(FirstNonCommentLine): first non-comment line is here // CHECK:STDERR: fn A(); // CHECK:STDERR: ^~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_after_import.carbon b/toolchain/parse/testdata/packages/package/fail_after_import.carbon index 13e0b9c7cba85..e913f09c39dbd 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_import.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_import.carbon @@ -10,10 +10,10 @@ import A; -// CHECK:STDERR: fail_after_import.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line +// CHECK:STDERR: fail_after_import.carbon:[[@LINE+6]]:1: error(PackageTooLate): the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_import.carbon:[[@LINE-5]]:1: note: first non-comment line is here +// CHECK:STDERR: fail_after_import.carbon:[[@LINE-5]]:1: note(FirstNonCommentLine): first non-comment line is here // CHECK:STDERR: import A; // CHECK:STDERR: ^~~~~~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_after_package.carbon b/toolchain/parse/testdata/packages/package/fail_after_package.carbon index 12d82f718a0d5..554bcfbc609e4 100644 --- a/toolchain/parse/testdata/packages/package/fail_after_package.carbon +++ b/toolchain/parse/testdata/packages/package/fail_after_package.carbon @@ -9,10 +9,10 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_after_package.carbon package A; -// CHECK:STDERR: fail_after_package.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line +// CHECK:STDERR: fail_after_package.carbon:[[@LINE+6]]:1: error(PackageTooLate): the `package` declaration must be the first non-comment line // CHECK:STDERR: package B; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_after_package.carbon:[[@LINE-4]]:1: note: first non-comment line is here +// CHECK:STDERR: fail_after_package.carbon:[[@LINE-4]]:1: note(FirstNonCommentLine): first non-comment line is here // CHECK:STDERR: package A; // CHECK:STDERR: ^~~~~~~ package B; diff --git a/toolchain/parse/testdata/packages/package/fail_extra_string.carbon b/toolchain/parse/testdata/packages/package/fail_extra_string.carbon index 1c980444ef545..684bc53a4f768 100644 --- a/toolchain/parse/testdata/packages/package/fail_extra_string.carbon +++ b/toolchain/parse/testdata/packages/package/fail_extra_string.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_extra_string.carbon -// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:27: error: `package` declarations must end with a `;` +// CHECK:STDERR: fail_extra_string.carbon:[[@LINE+3]]:27: error(ExpectedDeclSemi): `package` declarations must end with a `;` // CHECK:STDERR: package Foo library "bar" "baz"; // CHECK:STDERR: ^~~~~ package Foo library "bar" "baz"; diff --git a/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon b/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon index ebcff05e61cc7..4bf52287a7669 100644 --- a/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon +++ b/toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_library_is_identifier.carbon -// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:26: error: expected a string literal to specify the library name +// CHECK:STDERR: fail_library_is_identifier.carbon:[[@LINE+3]]:26: error(ExpectedLibraryName): expected a string literal to specify the library name // CHECK:STDERR: package Geometry library Shapes; // CHECK:STDERR: ^~~~~~ package Geometry library Shapes; diff --git a/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon b/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon index 2aea5f8e6db35..904494337e86f 100644 --- a/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon +++ b/toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_library_skips_name.carbon -// CHECK:STDERR: fail_library_skips_name.carbon:[[@LINE+3]]:9: error: expected identifier after `package` +// CHECK:STDERR: fail_library_skips_name.carbon:[[@LINE+3]]:9: error(ExpectedIdentifierAfterPackage): expected identifier after `package` // CHECK:STDERR: package library "Shapes"; // CHECK:STDERR: ^~~~~~~ package library "Shapes"; diff --git a/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon b/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon index e17ec94413f26..5bf66513ece37 100644 --- a/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon +++ b/toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_name_is_keyword.carbon -// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:9: error: expected identifier after `package` +// CHECK:STDERR: fail_name_is_keyword.carbon:[[@LINE+3]]:9: error(ExpectedIdentifierAfterPackage): expected identifier after `package` // CHECK:STDERR: package fn; // CHECK:STDERR: ^~ package fn; diff --git a/toolchain/parse/testdata/packages/package/fail_no_name.carbon b/toolchain/parse/testdata/packages/package/fail_no_name.carbon index cc78d664a3fc7..5b8d8cd95a488 100644 --- a/toolchain/parse/testdata/packages/package/fail_no_name.carbon +++ b/toolchain/parse/testdata/packages/package/fail_no_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_no_name.carbon -// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:8: error: expected identifier after `package` +// CHECK:STDERR: fail_no_name.carbon:[[@LINE+3]]:8: error(ExpectedIdentifierAfterPackage): expected identifier after `package` // CHECK:STDERR: package; // CHECK:STDERR: ^ package; diff --git a/toolchain/parse/testdata/packages/package/fail_no_semi.carbon b/toolchain/parse/testdata/packages/package/fail_no_semi.carbon index 9c1211ed89eaf..60f911687f278 100644 --- a/toolchain/parse/testdata/packages/package/fail_no_semi.carbon +++ b/toolchain/parse/testdata/packages/package/fail_no_semi.carbon @@ -10,7 +10,7 @@ package Geometry -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: error: `package` declarations must end with a `;` +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+10]]:21: error(ExpectedDeclSemi): `package` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon b/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon index 7d0c372da8cfd..d573b158d91fa 100644 --- a/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon +++ b/toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_omit_library_keyword.carbon -// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:18: error: missing `library` keyword +// CHECK:STDERR: fail_omit_library_keyword.carbon:[[@LINE+3]]:18: error(MissingLibraryKeyword): missing `library` keyword // CHECK:STDERR: package Geometry "Shapes"; // CHECK:STDERR: ^~~~~~~~ package Geometry "Shapes"; diff --git a/toolchain/parse/testdata/packages/package/fail_semi_before.carbon b/toolchain/parse/testdata/packages/package/fail_semi_before.carbon index 38232a2d5cfdf..307fb3a9d68bc 100644 --- a/toolchain/parse/testdata/packages/package/fail_semi_before.carbon +++ b/toolchain/parse/testdata/packages/package/fail_semi_before.carbon @@ -10,10 +10,10 @@ ; -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error: the `package` declaration must be the first non-comment line +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE+6]]:1: error(PackageTooLate): the `package` declaration must be the first non-comment line // CHECK:STDERR: package Geometry; // CHECK:STDERR: ^~~~~~~ -// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: note: first non-comment line is here +// CHECK:STDERR: fail_semi_before.carbon:[[@LINE-5]]:1: note(FirstNonCommentLine): first non-comment line is here // CHECK:STDERR: ; // CHECK:STDERR: ^ package Geometry; diff --git a/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon b/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon index a5f986d72e1ea..351530e3f0fed 100644 --- a/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon +++ b/toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/packages/package/fail_trailing_impl.carbon -// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+3]]:18: error: `package` declarations must end with a `;` +// CHECK:STDERR: fail_trailing_impl.carbon:[[@LINE+3]]:18: error(ExpectedDeclSemi): `package` declarations must end with a `;` // CHECK:STDERR: package Geometry impl; // CHECK:STDERR: ^~~~ package Geometry impl; diff --git a/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon b/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon index d8bcd0dd0d0ec..bc4a9d4b63f0e 100644 --- a/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon +++ b/toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/pointer/fail_pointer_type_in_expr.carbon fn F() -> i32 { - // CHECK:STDERR: fail_pointer_type_in_expr.carbon:[[@LINE+3]]:14: error: parentheses are required to disambiguate operator precedence + // CHECK:STDERR: fail_pointer_type_in_expr.carbon:[[@LINE+3]]:14: error(OperatorRequiresParentheses): parentheses are required to disambiguate operator precedence // CHECK:STDERR: return *i32*; // CHECK:STDERR: ^ return *i32*; diff --git a/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon b/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon index 9187356598555..7cffbc0cb25c2 100644 --- a/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon +++ b/toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon @@ -9,49 +9,49 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/pointer/fail_tuple_instead_of_compound_member_access.carbon fn F() { - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:6: error: expected expression + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:6: error(ExpectedExpr): expected expression // CHECK:STDERR: x.(); // CHECK:STDERR: ^ // CHECK:STDERR: x.(); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected `)` + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error(UnexpectedTokenInCompoundMemberAccess): expected `)` // CHECK:STDERR: y.(1,); // CHECK:STDERR: ^ // CHECK:STDERR: y.(1,); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected `)` + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error(UnexpectedTokenInCompoundMemberAccess): expected `)` // CHECK:STDERR: z.(a, b); // CHECK:STDERR: ^ // CHECK:STDERR: z.(a, b); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)` + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error(UnexpectedTokenInCompoundMemberAccess): expected `)` // CHECK:STDERR: w.(c d e ()); // CHECK:STDERR: ^ // CHECK:STDERR: w.(c d e ()); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error: expected expression + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:7: error(ExpectedExpr): expected expression // CHECK:STDERR: v->(); // CHECK:STDERR: ^ // CHECK:STDERR: v->(); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)` + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error(UnexpectedTokenInCompoundMemberAccess): expected `)` // CHECK:STDERR: u->(f,); // CHECK:STDERR: ^ // CHECK:STDERR: u->(f,); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error: expected `)` + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+4]]:8: error(UnexpectedTokenInCompoundMemberAccess): expected `)` // CHECK:STDERR: t->(2, 3); // CHECK:STDERR: ^ // CHECK:STDERR: t->(2, 3); - // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+3]]:9: error: expected `)` + // CHECK:STDERR: fail_tuple_instead_of_compound_member_access.carbon:[[@LINE+3]]:9: error(UnexpectedTokenInCompoundMemberAccess): expected `)` // CHECK:STDERR: s->(g h i ()); // CHECK:STDERR: ^ s->(g h i ()); diff --git a/toolchain/parse/testdata/return/fail_expr_no_semi.carbon b/toolchain/parse/testdata/return/fail_expr_no_semi.carbon index c91c8678d75df..34d8c4736d81e 100644 --- a/toolchain/parse/testdata/return/fail_expr_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_expr_no_semi.carbon @@ -10,7 +10,7 @@ fn F() { return x -// CHECK:STDERR: fail_expr_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` +// CHECK:STDERR: fail_expr_no_semi.carbon:[[@LINE+3]]:1: error(ExpectedStatementSemi): `return` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/return/fail_no_semi.carbon b/toolchain/parse/testdata/return/fail_no_semi.carbon index 804d57e01bf5b..e0cdc9952c2b4 100644 --- a/toolchain/parse/testdata/return/fail_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_no_semi.carbon @@ -10,11 +10,11 @@ fn F() { return -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+7]]:1: error: expected expression +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+7]]:1: error(ExpectedExpr): expected expression // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:1: error(ExpectedStatementSemi): `return` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/return/fail_returned_no_var.carbon b/toolchain/parse/testdata/return/fail_returned_no_var.carbon index 007290f0c0b8e..4f15fbb9fea45 100644 --- a/toolchain/parse/testdata/return/fail_returned_no_var.carbon +++ b/toolchain/parse/testdata/return/fail_returned_no_var.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/return/fail_returned_no_var.carbon fn F() -> String { - // CHECK:STDERR: fail_returned_no_var.carbon:[[@LINE+3]]:12: error: expected `var` after `returned` + // CHECK:STDERR: fail_returned_no_var.carbon:[[@LINE+3]]:12: error(ExpectedVarAfterReturned): expected `var` after `returned` // CHECK:STDERR: returned fn G() -> i32; // CHECK:STDERR: ^~ returned fn G() -> i32; diff --git a/toolchain/parse/testdata/return/fail_var_no_semi.carbon b/toolchain/parse/testdata/return/fail_var_no_semi.carbon index 5bda394838470..fe3b3321c4405 100644 --- a/toolchain/parse/testdata/return/fail_var_no_semi.carbon +++ b/toolchain/parse/testdata/return/fail_var_no_semi.carbon @@ -10,7 +10,7 @@ fn F() { return var -// CHECK:STDERR: fail_var_no_semi.carbon:[[@LINE+3]]:1: error: `return` statements must end with a `;` +// CHECK:STDERR: fail_var_no_semi.carbon:[[@LINE+3]]:1: error(ExpectedStatementSemi): `return` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/struct/fail_comma_only.carbon b/toolchain/parse/testdata/struct/fail_comma_only.carbon index dbe52a09dd6fa..95bb50961eac1 100644 --- a/toolchain/parse/testdata/struct/fail_comma_only.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_only.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_only.carbon -// CHECK:STDERR: fail_comma_only.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` +// CHECK:STDERR: fail_comma_only.carbon:[[@LINE+3]]:9: error(ExpectedStructLiteralField): expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {,} = {}; // CHECK:STDERR: ^ var x: {,} = {}; diff --git a/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon b/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon index f942e44bd1324..2ae6419a70990 100644 --- a/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_repeat_in_type.carbon -// CHECK:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+3]]:17: error: expected `.field: field_type` +// CHECK:STDERR: fail_comma_repeat_in_type.carbon:[[@LINE+3]]:17: error(ExpectedStructLiteralField): expected `.field: field_type` // CHECK:STDERR: var x: {.a: i32,,} = {}; // CHECK:STDERR: ^ var x: {.a: i32,,} = {}; diff --git a/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon b/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon index a3d80938583e6..d3e29cf8ebaa9 100644 --- a/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon +++ b/toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_comma_repeat_in_value.carbon -// CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: error: expected `.field = value` +// CHECK:STDERR: fail_comma_repeat_in_value.carbon:[[@LINE+3]]:16: error(ExpectedStructLiteralField): expected `.field = value` // CHECK:STDERR: var x: {.a = 0,,} = {}; // CHECK:STDERR: ^ var x: {.a = 0,,} = {}; diff --git a/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon b/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon index 4a7112875c5fd..80107eca2a548 100644 --- a/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon +++ b/toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_extra_token_in_type.carbon -// CHECK:STDERR: fail_extra_token_in_type.carbon:[[@LINE+3]]:17: error: expected `,` or `}` +// CHECK:STDERR: fail_extra_token_in_type.carbon:[[@LINE+3]]:17: error(UnexpectedTokenAfterListElement): expected `,` or `}` // CHECK:STDERR: var x: {.a: i32 banana} = {.a = 0}; // CHECK:STDERR: ^~~~~~ var x: {.a: i32 banana} = {.a = 0}; diff --git a/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon b/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon index a79a0f21ea60a..39919394c6376 100644 --- a/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon +++ b/toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_extra_token_in_value.carbon -// CHECK:STDERR: fail_extra_token_in_value.carbon:[[@LINE+3]]:28: error: expected `,` or `}` +// CHECK:STDERR: fail_extra_token_in_value.carbon:[[@LINE+3]]:28: error(UnexpectedTokenAfterListElement): expected `,` or `}` // CHECK:STDERR: var x: {.a: i32} = {.a = 0 banana}; // CHECK:STDERR: ^~~~~~ var x: {.a: i32} = {.a = 0 banana}; diff --git a/toolchain/parse/testdata/struct/fail_identifier_colon.carbon b/toolchain/parse/testdata/struct/fail_identifier_colon.carbon index 62dcc40674002..fad8e2a2ef06d 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_colon.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_colon.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_colon.carbon -// CHECK:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` +// CHECK:STDERR: fail_identifier_colon.carbon:[[@LINE+3]]:9: error(ExpectedStructLiteralField): expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {a:} = {}; // CHECK:STDERR: ^ var x: {a:} = {}; diff --git a/toolchain/parse/testdata/struct/fail_identifier_equals.carbon b/toolchain/parse/testdata/struct/fail_identifier_equals.carbon index 46ff9769cbf7e..dd4faf06ea32e 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_equals.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_equals.carbon -// CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` +// CHECK:STDERR: fail_identifier_equals.carbon:[[@LINE+3]]:9: error(ExpectedStructLiteralField): expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {a=} = {}; // CHECK:STDERR: ^ var x: {a=} = {}; diff --git a/toolchain/parse/testdata/struct/fail_identifier_only.carbon b/toolchain/parse/testdata/struct/fail_identifier_only.carbon index 375f9342be93d..99b0f77dbb7d2 100644 --- a/toolchain/parse/testdata/struct/fail_identifier_only.carbon +++ b/toolchain/parse/testdata/struct/fail_identifier_only.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_identifier_only.carbon -// CHECK:STDERR: fail_identifier_only.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` +// CHECK:STDERR: fail_identifier_only.carbon:[[@LINE+3]]:9: error(ExpectedStructLiteralField): expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {a} = {}; // CHECK:STDERR: ^ var x: {a} = {}; diff --git a/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon b/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon index 36da1916eec44..ab39ed3b8fb81 100644 --- a/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon +++ b/toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_invalid_struct_designator.carbon -// CHECK:STDERR: fail_invalid_struct_designator.carbon:[[@LINE+3]]:16: error: expected identifier after `.` +// CHECK:STDERR: fail_invalid_struct_designator.carbon:[[@LINE+3]]:16: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: var x: i32 = {.7 = 8}; // CHECK:STDERR: ^ var x: i32 = {.7 = 8}; diff --git a/toolchain/parse/testdata/struct/fail_missing_type.carbon b/toolchain/parse/testdata/struct/fail_missing_type.carbon index 491810ef6b2d1..35089d0fd138d 100644 --- a/toolchain/parse/testdata/struct/fail_missing_type.carbon +++ b/toolchain/parse/testdata/struct/fail_missing_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_missing_type.carbon -// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:12: error: expected expression +// CHECK:STDERR: fail_missing_type.carbon:[[@LINE+3]]:12: error(ExpectedExpr): expected expression // CHECK:STDERR: var x: {.a:} = {}; // CHECK:STDERR: ^ var x: {.a:} = {}; diff --git a/toolchain/parse/testdata/struct/fail_missing_value.carbon b/toolchain/parse/testdata/struct/fail_missing_value.carbon index ac41cea752488..24bc5d019649c 100644 --- a/toolchain/parse/testdata/struct/fail_missing_value.carbon +++ b/toolchain/parse/testdata/struct/fail_missing_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_missing_value.carbon -// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:12: error: expected expression +// CHECK:STDERR: fail_missing_value.carbon:[[@LINE+3]]:12: error(ExpectedExpr): expected expression // CHECK:STDERR: var x: {.a=} = {}; // CHECK:STDERR: ^ var x: {.a=} = {}; diff --git a/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon b/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon index 78c0bb4d0ba56..60072bc806706 100644 --- a/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_type_and_value.carbon -// CHECK:STDERR: fail_mix_type_and_value.carbon:[[@LINE+3]]:21: error: expected `.field: field_type` +// CHECK:STDERR: fail_mix_type_and_value.carbon:[[@LINE+3]]:21: error(ExpectedStructLiteralField): expected `.field: field_type` // CHECK:STDERR: var x: {.a: i32, .b = 0} = {}; // CHECK:STDERR: ^ var x: {.a: i32, .b = 0} = {}; diff --git a/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon b/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon index 73c9270cd97f7..fe1bc6a82188d 100644 --- a/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_value_and_type.carbon -// CHECK:STDERR: fail_mix_value_and_type.carbon:[[@LINE+3]]:17: error: expected `.field = value` +// CHECK:STDERR: fail_mix_value_and_type.carbon:[[@LINE+3]]:17: error(ExpectedStructLiteralField): expected `.field = value` // CHECK:STDERR: var x: {.a = 0, b: i32} = {}; // CHECK:STDERR: ^ var x: {.a = 0, b: i32} = {}; diff --git a/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon b/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon index 836dfc2935c52..cbd37a9a475e1 100644 --- a/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon +++ b/toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon @@ -8,21 +8,21 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_mix_with_unknown.carbon -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+8]]:25: error: expected `.field = value` +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+8]]:25: error(ExpectedStructLiteralField): expected `.field = value` // CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32}; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+4]]:29: error: expected `.field = value` +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+4]]:29: error(ExpectedStructLiteralField): expected `.field = value` // CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32}; // CHECK:STDERR: ^ // CHECK:STDERR: var x: i32 = {.a = 1, .b, .c: i32}; -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+7]]:26: error: expected `.field: field_type` +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+7]]:26: error(ExpectedStructLiteralField): expected `.field: field_type` // CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:31: error: expected `.field: field_type` +// CHECK:STDERR: fail_mix_with_unknown.carbon:[[@LINE+3]]:31: error(ExpectedStructLiteralField): expected `.field: field_type` // CHECK:STDERR: var x: i32 = {.a: i32, .b, .c = 1}; // CHECK:STDERR: ^ var x: i32 = {.a: i32, .b, .c = 1}; diff --git a/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon b/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon index 4fc06e2372e8c..0de998470918f 100644 --- a/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_no_colon_or_equals.carbon -// CHECK:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+3]]:11: error: expected `.field: field_type` or `.field = value` +// CHECK:STDERR: fail_no_colon_or_equals.carbon:[[@LINE+3]]:11: error(ExpectedStructLiteralField): expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {.a} = {}; // CHECK:STDERR: ^ var x: {.a} = {}; diff --git a/toolchain/parse/testdata/struct/fail_period_only.carbon b/toolchain/parse/testdata/struct/fail_period_only.carbon index e953de6760d13..87412decf59b1 100644 --- a/toolchain/parse/testdata/struct/fail_period_only.carbon +++ b/toolchain/parse/testdata/struct/fail_period_only.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_only.carbon -// CHECK:STDERR: fail_period_only.carbon:[[@LINE+3]]:10: error: expected identifier after `.` +// CHECK:STDERR: fail_period_only.carbon:[[@LINE+3]]:10: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: var x: {.} = {}; // CHECK:STDERR: ^ var x: {.} = {}; diff --git a/toolchain/parse/testdata/struct/fail_period_paren.carbon b/toolchain/parse/testdata/struct/fail_period_paren.carbon index 0d4ef238394aa..ab12de1c7e155 100644 --- a/toolchain/parse/testdata/struct/fail_period_paren.carbon +++ b/toolchain/parse/testdata/struct/fail_period_paren.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_paren.carbon -// CHECK:STDERR: fail_period_paren.carbon:[[@LINE+3]]:10: error: expected identifier after `.` +// CHECK:STDERR: fail_period_paren.carbon:[[@LINE+3]]:10: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: var x: {.(a) = 1}; // CHECK:STDERR: ^ var x: {.(a) = 1}; diff --git a/toolchain/parse/testdata/struct/fail_period_string_colon.carbon b/toolchain/parse/testdata/struct/fail_period_string_colon.carbon index 07aa55e7b4c1e..81d581b186671 100644 --- a/toolchain/parse/testdata/struct/fail_period_string_colon.carbon +++ b/toolchain/parse/testdata/struct/fail_period_string_colon.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_string_colon.carbon -// CHECK:STDERR: fail_period_string_colon.carbon:[[@LINE+3]]:10: error: expected identifier after `.` +// CHECK:STDERR: fail_period_string_colon.carbon:[[@LINE+3]]:10: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: var x: {."hello": i32, .y: i32} = {}; // CHECK:STDERR: ^~~~~~~ var x: {."hello": i32, .y: i32} = {}; diff --git a/toolchain/parse/testdata/struct/fail_period_string_equals.carbon b/toolchain/parse/testdata/struct/fail_period_string_equals.carbon index 15b7152c87989..e063999576629 100644 --- a/toolchain/parse/testdata/struct/fail_period_string_equals.carbon +++ b/toolchain/parse/testdata/struct/fail_period_string_equals.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_period_string_equals.carbon -// CHECK:STDERR: fail_period_string_equals.carbon:[[@LINE+3]]:10: error: expected identifier after `.` +// CHECK:STDERR: fail_period_string_equals.carbon:[[@LINE+3]]:10: error(ExpectedIdentifierAfterPeriodOrArrow): expected identifier after `.` // CHECK:STDERR: var x: {."hello" = 0, .y = 4} = {}; // CHECK:STDERR: ^~~~~~~ var x: {."hello" = 0, .y = 4} = {}; diff --git a/toolchain/parse/testdata/struct/fail_type_no_designator.carbon b/toolchain/parse/testdata/struct/fail_type_no_designator.carbon index 575a8d64701a0..6884655dcceeb 100644 --- a/toolchain/parse/testdata/struct/fail_type_no_designator.carbon +++ b/toolchain/parse/testdata/struct/fail_type_no_designator.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/struct/fail_type_no_designator.carbon -// CHECK:STDERR: fail_type_no_designator.carbon:[[@LINE+3]]:9: error: expected `.field: field_type` or `.field = value` +// CHECK:STDERR: fail_type_no_designator.carbon:[[@LINE+3]]:9: error(ExpectedStructLiteralField): expected `.field: field_type` or `.field = value` // CHECK:STDERR: var x: {i32} = {}; // CHECK:STDERR: ^~~ var x: {i32} = {}; diff --git a/toolchain/parse/testdata/var/fail_bad_name.carbon b/toolchain/parse/testdata/var/fail_bad_name.carbon index 56ca252554804..6dd35bceec7d6 100644 --- a/toolchain/parse/testdata/var/fail_bad_name.carbon +++ b/toolchain/parse/testdata/var/fail_bad_name.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/var/fail_bad_name.carbon -// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error: expected name in binding pattern +// CHECK:STDERR: fail_bad_name.carbon:[[@LINE+3]]:5: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: var *; // CHECK:STDERR: ^ var *; diff --git a/toolchain/parse/testdata/var/fail_empty.carbon b/toolchain/parse/testdata/var/fail_empty.carbon index 412b97118f533..0c69ad26b0315 100644 --- a/toolchain/parse/testdata/var/fail_empty.carbon +++ b/toolchain/parse/testdata/var/fail_empty.carbon @@ -8,7 +8,7 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/var/fail_empty.carbon -// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error: expected name in binding pattern +// CHECK:STDERR: fail_empty.carbon:[[@LINE+3]]:4: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: var; // CHECK:STDERR: ^ var; diff --git a/toolchain/parse/testdata/var/fail_no_semi.carbon b/toolchain/parse/testdata/var/fail_no_semi.carbon index ffb4a0dfc0d1a..9e236df4ce33e 100644 --- a/toolchain/parse/testdata/var/fail_no_semi.carbon +++ b/toolchain/parse/testdata/var/fail_no_semi.carbon @@ -10,11 +10,11 @@ var -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error: expected name in binding pattern +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+16]]:21: error(ExpectedBindingPattern): expected name in binding pattern // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error: `var` declarations must end with a `;` +// CHECK:STDERR: fail_no_semi.carbon:[[@LINE+12]]:21: error(ExpectedDeclSemi): `var` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: fail_no_semi.carbon diff --git a/toolchain/parse/testdata/where_expr/designators.carbon b/toolchain/parse/testdata/where_expr/designators.carbon index ae3c257cf96e4..29605b1a53ba5 100644 --- a/toolchain/parse/testdata/where_expr/designators.carbon +++ b/toolchain/parse/testdata/where_expr/designators.carbon @@ -18,7 +18,7 @@ fn Success() { // --- fail_numeric_designator.carbon fn FailNumeric() { - // CHECK:STDERR: fail_numeric_designator.carbon:[[@LINE+4]]:4: error: expected identifier or `Self` after `.` + // CHECK:STDERR: fail_numeric_designator.carbon:[[@LINE+4]]:4: error(ExpectedIdentifierOrSelfAfterPeriod): expected identifier or `Self` after `.` // CHECK:STDERR: .1; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -28,7 +28,7 @@ fn FailNumeric() { // --- fail_keyword_designator.carbon fn FailKeyword() { - // CHECK:STDERR: fail_keyword_designator.carbon:[[@LINE+4]]:4: error: expected identifier or `Self` after `.` + // CHECK:STDERR: fail_keyword_designator.carbon:[[@LINE+4]]:4: error(ExpectedIdentifierOrSelfAfterPeriod): expected identifier or `Self` after `.` // CHECK:STDERR: .base; // CHECK:STDERR: ^~~~ // CHECK:STDERR: @@ -38,7 +38,7 @@ fn FailKeyword() { // --- fail_empty_designator.carbon fn FailEmpty() { - // CHECK:STDERR: fail_empty_designator.carbon:[[@LINE+4]]:4: error: expected identifier or `Self` after `.` + // CHECK:STDERR: fail_empty_designator.carbon:[[@LINE+4]]:4: error(ExpectedIdentifierOrSelfAfterPeriod): expected identifier or `Self` after `.` // CHECK:STDERR: .; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -48,7 +48,7 @@ fn FailEmpty() { // --- fail_star_designator.carbon fn FailStar() { - // CHECK:STDERR: fail_star_designator.carbon:[[@LINE+4]]:4: error: expected identifier or `Self` after `.` + // CHECK:STDERR: fail_star_designator.carbon:[[@LINE+4]]:4: error(ExpectedIdentifierOrSelfAfterPeriod): expected identifier or `Self` after `.` // CHECK:STDERR: .*; // CHECK:STDERR: ^ // CHECK:STDERR: @@ -59,11 +59,11 @@ fn FailStar() { var x: i32 = . -// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+93]]:21: error: expected identifier or `Self` after `.` +// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+93]]:21: error(ExpectedIdentifierOrSelfAfterPeriod): expected identifier or `Self` after `.` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDERR: -// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+89]]:21: error: `var` declarations must end with a `;` +// CHECK:STDERR: fail_designator_eof.carbon:[[@LINE+89]]:21: error(ExpectedDeclSemi): `var` declarations must end with a `;` // CHECK:STDERR: // CHECK:STDOUT: ] // CHECK:STDERR: ^ // CHECK:STDOUT: - filename: designator.carbon diff --git a/toolchain/parse/testdata/where_expr/fail_rewrite.carbon b/toolchain/parse/testdata/where_expr/fail_rewrite.carbon index 911d60b971299..159d16c0ba7fa 100644 --- a/toolchain/parse/testdata/where_expr/fail_rewrite.carbon +++ b/toolchain/parse/testdata/where_expr/fail_rewrite.carbon @@ -13,7 +13,7 @@ // --- fail_not_designator.carbon -// CHECK:STDERR: fail_not_designator.carbon:[[@LINE+4]]:37: error: requirement can only use `=` after `.member` designator +// CHECK:STDERR: fail_not_designator.carbon:[[@LINE+4]]:37: error(RequirementEqualAfterNonDesignator): requirement can only use `=` after `.member` designator // CHECK:STDERR: fn NotDesignator(T:! type where i32 = .U); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -21,7 +21,7 @@ fn NotDesignator(T:! type where i32 = .U); // --- fail_designator_in_parens.carbon -// CHECK:STDERR: fail_designator_in_parens.carbon:[[@LINE+4]]:40: error: requirement can only use `=` after `.member` designator +// CHECK:STDERR: fail_designator_in_parens.carbon:[[@LINE+4]]:40: error(RequirementEqualAfterNonDesignator): requirement can only use `=` after `.member` designator // CHECK:STDERR: fn DesignatorInParens(V:! I where (.J) = bool); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -29,7 +29,7 @@ fn DesignatorInParens(V:! I where (.J) = bool); // --- fail_dot_self.carbon -// CHECK:STDERR: fail_dot_self.carbon:[[@LINE+4]]:30: error: requirement can only use `=` after `.member` designator +// CHECK:STDERR: fail_dot_self.carbon:[[@LINE+4]]:30: error(RequirementEqualAfterNonDesignator): requirement can only use `=` after `.member` designator // CHECK:STDERR: fn DotSelf(W:! K where .Self = f32); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -37,7 +37,7 @@ fn DotSelf(W:! K where .Self = f32); // --- fail_dot_keyword.carbon -// CHECK:STDERR: fail_dot_keyword.carbon:[[@LINE+4]]:28: error: expected identifier or `Self` after `.` +// CHECK:STDERR: fail_dot_keyword.carbon:[[@LINE+4]]:28: error(ExpectedIdentifierOrSelfAfterPeriod): expected identifier or `Self` after `.` // CHECK:STDERR: fn DotKeyword(W:! K where .and = u8); // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -45,7 +45,7 @@ fn DotKeyword(W:! K where .and = u8); // --- fail_postfix_after_designator.carbon -// CHECK:STDERR: fail_postfix_after_designator.carbon:[[@LINE+4]]:43: error: requirement can only use `=` after `.member` designator +// CHECK:STDERR: fail_postfix_after_designator.carbon:[[@LINE+4]]:43: error(RequirementEqualAfterNonDesignator): requirement can only use `=` after `.member` designator // CHECK:STDERR: fn PostfixAfterDesignator(X:! L where .M* = u64*); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -53,7 +53,7 @@ fn PostfixAfterDesignator(X:! L where .M* = u64*); // --- fail_binary_op_after_designator.carbon -// CHECK:STDERR: fail_binary_op_after_designator.carbon:[[@LINE+4]]:48: error: requirement can only use `=` after `.member` designator +// CHECK:STDERR: fail_binary_op_after_designator.carbon:[[@LINE+4]]:48: error(RequirementEqualAfterNonDesignator): requirement can only use `=` after `.member` designator // CHECK:STDERR: fn BinaryOpAfterDesignator(Y:! N where .O + .P = {}); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -61,7 +61,7 @@ fn BinaryOpAfterDesignator(Y:! N where .O + .P = {}); // --- fail_after_and.carbon -// CHECK:STDERR: fail_after_and.carbon:[[@LINE+3]]:43: error: requirement can only use `=` after `.member` designator +// CHECK:STDERR: fail_after_and.carbon:[[@LINE+3]]:43: error(RequirementEqualAfterNonDesignator): requirement can only use `=` after `.member` designator // CHECK:STDERR: fn AfterAnd(Z:! Q where .R impls S and () = .A); // CHECK:STDERR: ^ fn AfterAnd(Z:! Q where .R impls S and () = .A); diff --git a/toolchain/parse/testdata/where_expr/where_and.carbon b/toolchain/parse/testdata/where_expr/where_and.carbon index d528205493277..fbf69f04cf7f8 100644 --- a/toolchain/parse/testdata/where_expr/where_and.carbon +++ b/toolchain/parse/testdata/where_expr/where_and.carbon @@ -16,7 +16,7 @@ fn TwoAnd(Y:! I where .J impls K and .L == .M and .N = bool); // --- fail_and_prefix.carbon -// CHECK:STDERR: fail_and_prefix.carbon:[[@LINE+4]]:29: error: expected expression +// CHECK:STDERR: fail_and_prefix.carbon:[[@LINE+4]]:29: error(ExpectedExpr): expected expression // CHECK:STDERR: fn AndPrefix(T:! type where and .V == .W); // CHECK:STDERR: ^~~ // CHECK:STDERR: @@ -24,7 +24,7 @@ fn AndPrefix(T:! type where and .V == .W); // --- fail_and_suffix.carbon -// CHECK:STDERR: fail_and_suffix.carbon:[[@LINE+4]]:40: error: expected expression +// CHECK:STDERR: fail_and_suffix.carbon:[[@LINE+4]]:40: error(ExpectedExpr): expected expression // CHECK:STDERR: fn AndSuffix(Y:! I where .J impls K and); // CHECK:STDERR: ^ // CHECK:STDERR: @@ -32,7 +32,7 @@ fn AndSuffix(Y:! I where .J impls K and); // --- fail_and_early.carbon -// CHECK:STDERR: fail_and_early.carbon:[[@LINE+3]]:28: error: requirement should use `impls`, `=`, or `==` operator +// CHECK:STDERR: fail_and_early.carbon:[[@LINE+3]]:28: error(ExpectedRequirementOperator): requirement should use `impls`, `=`, or `==` operator // CHECK:STDERR: fn AndEarly(Z:! L where .M and N); // CHECK:STDERR: ^~~ fn AndEarly(Z:! L where .M and N); diff --git a/toolchain/parse/testdata/while/fail_missing_cond.carbon b/toolchain/parse/testdata/while/fail_missing_cond.carbon index d8cd219a6aff4..6bd54c641635b 100644 --- a/toolchain/parse/testdata/while/fail_missing_cond.carbon +++ b/toolchain/parse/testdata/while/fail_missing_cond.carbon @@ -9,7 +9,7 @@ // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/parse/testdata/while/fail_missing_cond.carbon fn F() { - // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:9: error: expected `(` after `while` + // CHECK:STDERR: fail_missing_cond.carbon:[[@LINE+3]]:9: error(ExpectedParenAfter): expected `(` after `while` // CHECK:STDERR: while { // CHECK:STDERR: ^ while { diff --git a/toolchain/parse/testdata/while/fail_no_semi.carbon b/toolchain/parse/testdata/while/fail_no_semi.carbon index f51349a009fcc..c5d83d3403f7f 100644 --- a/toolchain/parse/testdata/while/fail_no_semi.carbon +++ b/toolchain/parse/testdata/while/fail_no_semi.carbon @@ -12,14 +12,14 @@ fn F() { while (a) { if (b) { break - // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:5: error: `break` statements must end with a `;` + // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+4]]:5: error(ExpectedStatementSemi): `break` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ // CHECK:STDERR: } if (c) { continue - // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:5: error: `continue` statements must end with a `;` + // CHECK:STDERR: fail_no_semi.carbon:[[@LINE+3]]:5: error(ExpectedStatementSemi): `continue` statements must end with a `;` // CHECK:STDERR: } // CHECK:STDERR: ^ } diff --git a/toolchain/parse/testdata/while/fail_unbraced.carbon b/toolchain/parse/testdata/while/fail_unbraced.carbon index 38fc968b85932..18c2e21788186 100644 --- a/toolchain/parse/testdata/while/fail_unbraced.carbon +++ b/toolchain/parse/testdata/while/fail_unbraced.carbon @@ -11,7 +11,7 @@ fn F() { while (a) - // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:5: error: expected braced code block + // CHECK:STDERR: fail_unbraced.carbon:[[@LINE+3]]:5: error(ExpectedCodeBlock): expected braced code block // CHECK:STDERR: break; // CHECK:STDERR: ^~~~~ break; diff --git a/toolchain/testing/file_test.cpp b/toolchain/testing/file_test.cpp index 2c0daea468b99..0339af978827f 100644 --- a/toolchain/testing/file_test.cpp +++ b/toolchain/testing/file_test.cpp @@ -63,8 +63,8 @@ class ToolchainFileTest : public FileTestBase { return {"format", "%s"}; } - llvm::SmallVector args = {"compile", - "--phase=" + component_.str()}; + llvm::SmallVector args = { + "compile", "--include-diagnostic-kind", "--phase=" + component_.str()}; if (component_ == "lex") { args.push_back("--dump-tokens");