nested_tuple_pattern.carbon 545 B

123456789101112131415161718192021222324252627
  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. let (var Ints.Two(a1: auto, var a2: auto),
  14. ((b: auto, var c: auto), var (d: auto, e: auto))) =
  15. (Ints.Two(1, 10), ((2, 3), (4, 5)));
  16. a1 = 0;
  17. a2 = 0;
  18. c = 0;
  19. d = 0;
  20. e = 0;
  21. return 0;
  22. }
  23. // CHECK:STDOUT: result: 0