fail_choice_no_parens.carbon 616 B

1234567891011121314151617181920212223
  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. package ExplorerTest api;
  7. choice Ints {
  8. None(),
  9. One(i32),
  10. Two(i32, i32)
  11. }
  12. fn Main() -> i32 {
  13. match (Ints.None) {
  14. case Ints.None() => { return 0; }
  15. // CHECK:STDERR: COMPILATION ERROR: fail_choice_no_parens.carbon:[[@LINE+3]]: type error in `match` pattern type
  16. // CHECK:STDERR: expected: choice Ints
  17. // CHECK:STDERR: actual: fn () -> choice Ints
  18. default => { return 1; }
  19. }
  20. }