tuple_match3.carbon 388 B

12345678910111213
  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. // Test matching of a tuple inside a tuple.
  5. fn main() -> i32 {
  6. var t: auto = ((1,2),(3,4));
  7. match (t) {
  8. case ((a: auto, b: auto), c: auto) =>
  9. return a - b + c[0] - c[1] + 2;
  10. }
  11. }