Decomposer patterns supported: any expression resolvable in the context of the matched one and returning a tuple is a decomposer

This commit is contained in:
Andrey Breslav
2011-05-20 22:24:13 +04:00
parent 0afddb4d9e
commit a1e055af89
19 changed files with 256 additions and 59 deletions
+5 -1
View File
@@ -43,5 +43,9 @@ fun test() {
is (1, 1) => 1
is (1, <error>"1"</error>) => 1
is <error>(1, "1", *)</error> => 1
is boo @ (1, <error>"a"</error>, *) => 1
is boo @ <error>(1, *)</error> => 1
}
}
}
val (Int, Int).boo : (Int, Int, Int) = (1, 1, 1)