fail_redundant_int.carbon 664 B

12345678910111213141516171819202122
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // RUN: %{not} %{explorer-run}
  7. // RUN: %{not} %{explorer-run-trace}
  8. package ExplorerTest api;
  9. fn A(n: i32) -> i32 {
  10. match (n) {
  11. case 1 => { return 1; }
  12. // CHECK:STDERR: COMPILATION ERROR: {{.*}}/explorer/testdata/match/fail_redundant_int.carbon:[[@LINE+1]]: unreachable case: all values matched by this case are matched by earlier cases
  13. case 1 => { return 2; }
  14. case (_: i32) => { return 3; }
  15. }
  16. }
  17. fn Main() -> i32 {
  18. return A(1);
  19. }