Support complex type patterns in bindings. (#759)

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
This commit is contained in:
Geoff Romer
2021-08-18 13:40:17 -07:00
committed by GitHub
co-authored by Jon Meow
parent 2295658697
commit 7138ee400f
7 changed files with 87 additions and 73 deletions
+1 -3
View File
@@ -1,4 +1,2 @@
COMPILATION ERROR: 8: type error in pattern variable
expected: (x = i32, y = i32)
actual: (y = i32, x = i32)
PROGRAM ERROR: 8: Tuple field name 'y' does not match pattern field name 'x'
EXIT CODE: 255
+8
View File
@@ -0,0 +1,8 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
fn main() -> i32 {
var t: (auto, (i32, i32)) = ((1,2),(3,4));
return t[0][0] + t[1][1] - 5;
}
+1
View File
@@ -0,0 +1 @@
result: 0