nested_tuple_pattern.carbon 544 B

1234567891011121314151617181920212223242526
  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. // CHECK:STDOUT: result: 0
  7. package ExplorerTest api;
  8. choice Ints {
  9. None,
  10. One(i32),
  11. Two(i32, i32)
  12. }
  13. fn Main() -> i32 {
  14. let (var Ints.Two(a1: auto, var a2: auto),
  15. ((b: auto, var c: auto), var (d: auto, e: auto))) =
  16. (Ints.Two(1, 10), ((2, 3), (4, 5)));
  17. a1 = 0;
  18. a2 = 0;
  19. c = 0;
  20. d = 0;
  21. e = 0;
  22. return 0;
  23. }