fail_choice_extra_parens.carbon 553 B

123456789101112131415161718192021
  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. choice Ints {
  8. None,
  9. One(i32),
  10. Two(i32, i32)
  11. }
  12. fn Main() -> i32 {
  13. // CHECK:STDERR: COMPILATION ERROR: fail_choice_extra_parens.carbon:[[@LINE+1]]: alternative `choice Ints.None` does not expect an argument list
  14. match (Ints.None()) {
  15. case Ints.None => { return 0; }
  16. default => { return 1; }
  17. }
  18. }