fail_not_alternative.carbon 490 B

123456789101112131415161718
  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. // NOAUTOUPDATE
  6. package ExplorerTest api;
  7. fn Main() -> i32 {
  8. var x: i32 = 0;
  9. match (x) {
  10. // CHECK:STDERR: SYNTAX ERROR: fail_not_alternative.carbon:[[@LINE+1]]: Alternative pattern must have the form of a field access.
  11. case i32(n: i32) => {
  12. return 1;
  13. }
  14. }
  15. return 0;
  16. }