Allow patterns in lets and list comprehension binds

This commit is contained in:
Ulf Norell
2019-12-10 16:12:08 +01:00
parent d844c4d276
commit b51a79b5e1
10 changed files with 70 additions and 43 deletions
+13
View File
@@ -0,0 +1,13 @@
contract LetPatterns =
record r = {x : int, y : int, b : bool}
entrypoint test() = foo([1, 0], (2, 3), Some(4), {x = 5, y = 6, b = false})
entrypoint foo(xs : list(int), p : int * int, some : option(int), r : r) =
let x :: _ = xs
let (a, b) = p
let Some(n) = some
let {x = i, y = j} = r
x + a + b + n + i + j